[JAVA-850] DBObject of size (smaller than 16 mb) is over Max BSON size 16777216 Created: 08/Jun/13 Updated: 31/Mar/15 Resolved: 25/Jun/13 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Connection Management |
| Affects Version/s: | 2.11.0, 3.0.0 |
| Fix Version/s: | 3.0.0 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | rohit.nijhawan@10gen.com | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Java Driver on linux, osx with mongo 2.4.2 |
||
| Attachments: |
|
| Description |
|
Exception in thread "main" com.mongodb.MongoInternalException: DBObject of size 5242897 is over Max BSON size 16777216 Perhaps it IS the intended behaviour to not allow queries or remove operation's query parameters to exceed 4mb - the limit in Bytes.MAX_OBJECT_SIZE, but this message is very strange, and can easily throw off a developer. Note that in OutMessage.java we check max on one thing _mongo.getConnector().getMaxBsonObjectSize() ...but report it on something else - which incidentally initializes it correctly. if (objectSize > Math.max(_mongo.getConnector().getMaxBsonObjectSize(), Bytes.MAX_OBJECT_SIZE)) { throw new MongoInternalException("DBObject of size " + objectSize + " is over Max BSON size " + _mongo.getMaxBsonObjectSize()); } |
| Comments |
| Comment by Jeffrey Yemin [ 31/Mar/15 ] | |||||||||||||||||||||||
|
Closing all resolved 3.0.0 issues, as 3.0.0 has been tagged and released. | |||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 25/Jun/13 ] | |||||||||||||||||||||||
|
Code is re-written in 3.0.x branch, and this is fixed by design. | |||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 13/Jun/13 ] | |||||||||||||||||||||||
|
OK, we'll definitely get this fixed, just not sure exactly when. | |||||||||||||||||||||||
| Comment by rohit.nijhawan@10gen.com [ 13/Jun/13 ] | |||||||||||||||||||||||
|
A customer I am working with is performing a remove with field:{$in:[v1,v2,v3,v4,....]} It's a problem they've avoided thus far. | |||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 12/Jun/13 ] | |||||||||||||||||||||||
|
Do you have an actual use case for having such a large remove or update message? | |||||||||||||||||||||||
| Comment by rohit.nijhawan@10gen.com [ 12/Jun/13 ] | |||||||||||||||||||||||
|
Yes I concur. If you run any other operation prior to it, things start and continue to work. | |||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 11/Jun/13 ] | |||||||||||||||||||||||
|
Thanks for the test case. I can see that this will only occur if the very first message you create is larger that 4MB. For example, this program works correctly:
| |||||||||||||||||||||||
| Comment by rohit.nijhawan@10gen.com [ 11/Jun/13 ] | |||||||||||||||||||||||
|
The reproducible case is in the file I attached. The stacktrace is pasted below Exception in thread "main" com.mongodb.MongoInternalException: DBObject of size 5242906 is over Max BSON size 16777216 | |||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 08/Jun/13 ] | |||||||||||||||||||||||
|
A few questions:
|