Ubuntu Pastebin

Paste from tim at Fri, 2 Jun 2017 05:36:58 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
diff --git a/state/upgrades.go b/state/upgrades.go
index aa3216a..2e7b78f 100644
--- a/state/upgrades.go
+++ b/state/upgrades.go
@@ -730,7 +730,7 @@ func SplitLogCollections(st *State) error {
 	iter := oldLogs.Find(nil).Iter()
 	var (
 		doc bson.M
-		ids []string
+		ids []interface{}
 	)
 
 	for iter.Next(&doc) {
@@ -751,7 +751,7 @@ func SplitLogCollections(st *State) error {
 		if err := newLogs.Insert(doc); err != nil {
 			return errors.Annotate(err, "failed to insert log record")
 		}
-		ids = append(ids, doc["_id"].(string))
+		ids = append(ids, doc["_id"])
 		if len(ids) >= splitBatchRemoveSize {
 			if err := oldLogs.Remove(bson.D{{"_id", bson.D{{"$in", ids}}}}); err != nil {
 				return errors.Annotate(err, "failed to remove batch of logs")
Download as text