[SERVER-2639] Inserting into a capped collection an object larger than max size fails silently Created: 11/Feb/11 Updated: 12/Jul/16 Resolved: 06/Jun/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.1.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jonas Lindholm | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | rn | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux 64 bit mongoDB 1.6.5 |
||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
I have a capped collection with max: 1 and size :10000 If I insert/update an object that is larger than 10000 bytes the returned _id is a valid ID, i.e. the insert does not croak, but no data is inserted. I've not tried to insert data larger than max size of 10000 bytes with any other method so I'm not sure if it is a problem with the Perl driver or with mongoDB it self. Of course it was easy to fix by increasing the size to more than 10000 but the insert should at least fail as I was not expecting to lose existing data and ending up with no data at all. |
| Comments |
| Comment by auto [ 03/Jun/12 ] |
|
Author: {u'login': u'erh', u'name': u'Eliot Horowitz', u'email': u'eliot@10gen.com'}Message: |
| Comment by Kristina Chodorow (Inactive) [ 28/Feb/11 ] |
|
Example: > db.createCollection("bar", {capped : true, size : 100, max : 1}) { "ok" : 1 }> db.bar.insert( {x:"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"}) It throws an error in the log. Mon Feb 28 13:41:58 [conn1] couldn't make room for new record (len: 148) in capped ns test.bar |