-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.6.1
-
Component/s: Write Ops
-
None
-
Query
-
ALL
Can make updates on capped collections, including without Id index, but on oplog.rs in local:
db.getSiblingDB("local").oplog.rs.find({ "ts" : Timestamp(1401418539, 1), "h" : NumberLong("-4571530663222791900")}) { "ts" : Timestamp(1401418539, 1), "h" : NumberLong("-4571530663222791900"), "v" : 2, "op" : "i", "ns" : "blog.docs", "o" : { "_id" : ObjectId("5387f32bad47a6460bac5994"), "docId" : 999 } } > db.getSiblingDB("local").oplog.rs.update({ "ts" : Timestamp(1401418539, 1), "h" : NumberLong("-4571530663222791900")}, {$set:{op:"c"}}) WriteResult({ "nMatched" : 0, "nUpserted" : 0, "nModified" : 0, "writeError" : { "code" : 10003, "errmsg" : "failing update: objects in a capped ns cannot grow" } }) > db.getSiblingDB("local").oplog.rs.update({ "ts" : Timestamp(1401418539, 1), "h" : NumberLong("-4571530663222791900")}, {$inc:{v:1}}) WriteResult({ "nMatched" : 0, "nUpserted" : 0, "nModified" : 0, "writeError" : { "code" : 10003, "errmsg" : "failing update: objects in a capped ns cannot grow" } }) > db.getSiblingDB("local").oplog.rs.update({ "ts" : Timestamp(1401418539, 1), "h" : NumberLong("-4571530663222791900")}, {$inc:{"o.docId":1}}) WriteResult({ "nMatched" : 0, "nUpserted" : 0, "nModified" : 0, "writeError" : { "code" : 10003, "errmsg" : "failing update: objects in a capped ns cannot grow" } })
As it turns out, if I shrink the new doc by A LOT I can get it in (but not shrinking by a little). So somewhere there's a calculation that's maybe adding ts and h twice or something like that.
/* shrink by 15 bytes and it doesn't fit still */ db.getSiblingDB("local").oplog.rs.update({ "ts" : Timestamp(1401418539, 1), "h" : NumberLong("-4571530663222791900")},{ "ts" : Timestamp(1401418539, 1), "h" : NumberLong("-4571530663222791900"), "v" : NumberInt(2), "op" : "i", "ns" : "b.d", "o" : { "_id" : NumberInt(0), "doc1" : NumberLong(999) } }) WriteResult({ "nMatched" : 0, "nUpserted" : 0, "nModified" : 0, "writeError" : { "code" : 10003, "errmsg" : "failing update: objects in a capped ns cannot grow" } }) /* shrink by 16 bytes and it "fits" */ db.getSiblingDB("local").oplog.rs.update({ "ts" : Timestamp(1401418539, 1), "h" : NumberLong("-4571530663222791900")}, { "ts" : Timestamp(1401418539, 1), "h" : NumberLong("-4571530663222791900"), "v" : NumberInt(2), "op" : "i", "ns" : "b.d", "o" : { "_id" : NumberInt(0), "doc": NumberLong(888) } }) WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
- related to
-
SERVER-11983 Update on document without _id, in capped collection without _id index, creates an _id field
- Closed
-
SERVER-20529 WiredTiger allows capped collection objects to grow
- Closed