Details
-
Bug
-
Resolution: Done
-
Major - P3
-
3.0.2
-
None
-
Minor Change
-
ALL
-
QuInt A (10/12/15)
Description
In MMAP items in a capped collection cannot grow - as per the documentation and an error is raised if they do.
> db.createCollection("cap",{capped:true,size:128000})
|
{ "ok" : 1 }
|
> db.cap.update({_id:1},{$set:{test:"hello",vals:["one"]}},true,true)
|
WriteResult({ "nMatched" : 0, "nUpserted" : 1, "nModified" : 0, "_id" : 1 })
|
> db.cap.update({_id:1},{$set:{test:"hello"},$push:{vals:"two"}},true,true)
|
WriteResult({
|
"nMatched" : 0,
|
"nUpserted" : 0,
|
"nModified" : 0,
|
"writeError" : {
|
"code" : 10003,
|
"errmsg" : "failing update: objects in a capped ns cannot grow"
|
}
|
})
|
In WiredTiger they are allowed to grow - is this deliberate?
> db.createCollection("cap",{capped:true,size:128000})
|
{ "ok" : 1 }
|
> db.cap.update({_id:1},{$set:{test:"hello",vals:["one"]}},true,true)
|
WriteResult({ "nMatched" : 0, "nUpserted" : 1, "nModified" : 0, "_id" : 1 })
|
> db.cap.findOne()
|
{ "_id" : 1, "test" : "hello", "vals" : [ "one" ] }
|
> db.cap.update({_id:1},{$set:{test:"hello"},$push:{vals:"two"}},true,true)
|
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
|
> db.cap.findOne()
|
{ "_id" : 1, "test" : "hello", "vals" : [ "one", "two" ] }
|
Attachments
Issue Links
- is documented by
-
DOCS-8961 [Server] WiredTiger allows capped collection objects to grow
-
- Ready for Work
-
- is duplicated by
-
SERVER-23981 Incompatible to update capped collection after upgrade to MongoDB-3.2
-
- Closed
-
- is related to
-
SERVER-6984 Initial sync can fail, or break future replication, when updates shrink or grow docs in capped collections
-
- Closed
-
-
SERVER-11983 Update on document without _id, in capped collection without _id index, creates an _id field
-
- Closed
-
-
SERVER-14115 cannot perform an in-place update on oplog
-
- Closed
-
-
SERVER-19551 Keep "milestones" against WT oplog to efficiently remove old records
-
- Closed
-
- related to
-
SERVER-58865 Remove obsolete restriction on capped collection objects
-
- Closed
-