[DOCS-8961] [Server] WiredTiger allows capped collection objects to grow Created: 28/Sep/16  Updated: 16/Aug/23

Status: Ready for Work
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Emily Hall Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: proactive
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-20529 WiredTiger allows capped collection o... Closed
Related
related to SERVER-58865 Remove obsolete restriction on capped... Closed
Participants:
Days since reply: 1 year, 8 weeks, 5 days ago

 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" ] }



 Comments   
Comment by Benety Goh [ 09/Dec/22 ]

sarah.olson@mongodb.com, it would be a good idea to work with a docs engineer/writer to go over the existing documentation on update operations and capped collections, if only to review what we have today is still accurate.

Comment by Sarah Olson [ 09/Dec/22 ]

Hi benety.goh@mongodb.com and daniel.gottlieb@mongodb.com. We're working on addressing some of the older Server docs tickets in our backlog, and will work on this one shortly. Before we do that, I was wondering if you would mind taking a quick look and confirming whether this is still relevant and necessary. Thanks very much!

Comment by Sarah Olson [ 09/Dec/22 ]

Hi emily.hall, we're looking at this ticket for the Server docs. Can you confirm that this is still relevant and necessary? Thanks so much!

Generated at Thu Feb 08 07:57:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.