[SERVER-4715] Check quota before deleting object to move in update Created: 19/Jan/12  Updated: 11/Jul/16  Resolved: 28/Feb/12

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: None
Fix Version/s: 2.1.1

Type: Bug Priority: Major - P3
Reporter: Mathias Stearn Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 3
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Operating System: ALL
Participants:

 Description   

Start mongod with --quota --quotaFiles 1 --smallfiles

> db.foo.dropDatabase()
Wed Jan 18 19:08:42 TypeError: db.foo.dropDatabase is not a function (shell):1
> db.dropDatabase()
{ "dropped" : "test", "ok" : 1 }
> x = 'x'
x
> while (x.length < 1024*1024) x += x; x.length
1048576
> for (var i=0; i< 20; i++ ){ db.foo.save({_id:i, x:x}) }
quota exceeded
> db.foo.find({_id:0}, {_id:1})
{ "_id" : 0 }
> db.foo.count()
16
 
All good to this point
 
> db.foo.save({_id:0, x:x+x}) //boom
quota exceeded
> db.foo.find({_id:0}, {_id:1})
> db.foo.count()
15

I'll commit a test for this tomorrow.



 Comments   
Comment by auto [ 29/Feb/12 ]

Author:

{u'login': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}

Message: reset Client::hasWritten this pass at beginning of new requests, part of SERVER-4715
Branch: master
https://github.com/mongodb/mongo/commit/265c196adacccb4d1d0c0b0a9b1a8a3260198c8b

Comment by Eliot Horowitz (Inactive) [ 28/Feb/12 ]

This specific issue is resolved.
It does open a new issue where --quota is not enforced. SERVER-5136

Comment by auto [ 28/Feb/12 ]

Author:

{u'login': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}

Message: SERVER-4715 don't uassert for quota issues if have done any writes so far
Branch: master
https://github.com/mongodb/mongo/commit/0425cfd1f44bb719902930d8413351485c25ab0b

Comment by Dwight Merriman [ 28/Feb/12 ]

perhaps the simplest solution is to not uassert if cc()._hasWrittenThisPass is nonzero.

this may be not ideally strict, but likely pretty safe.

Generated at Thu Feb 08 03:06:46 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.