[JAVA-289] driver does not allow doc sizes matching the server limit, for both insert and find Created: 02/Mar/11  Updated: 17/Mar/11  Resolved: 03/Mar/11

Status: Closed
Project: Java Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 2.5

Type: Bug Priority: Major - P3
Reporter: Antoine Girbal Assignee: Antoine Girbal
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

we upped server limit to 16MB.
driver still limits around 3MB.



 Comments   
Comment by auto [ 04/Mar/11 ]

Author:

{u'login': u'agirbal', u'name': u'agirbal', u'email': u'antoine@10gen.com'}

Message: JAVA-289: detect max bson size from servers. Update whenever master changes. Fetch on 1st op in single server mode.
https://github.com/mongodb/mongo-java-driver/commit/f634fe8456607d97de7fffb38aa98d9e1cd82f75

Comment by auto [ 02/Mar/11 ]

Author:

{u'login': u'agirbal', u'name': u'agirbal', u'email': u'antoine@10gen.com'}

Message: JAVA-289: convenience methods to obtain max bson size object
https://github.com/mongodb/mongo-java-driver/commit/2ee21e9d56a9f4ffe900b217c5215de7402787d8

Comment by Antoine Girbal [ 02/Mar/11 ]

It is messy to try to put limits on driver side:

  • driver may be talking to dbs with different size limits
  • all operations must apply limits
  • for updates if you do multiple $set of large fields, doc on server side would go over limit
  • every time we change server limits, have to change driver's

Since server is properly returning an error if doc is too large, then driver just has to relay error as MongoException.

Before driver only checked on inserts with limit of 4MB.
Now driver only checks on inserts with limit of 32MB, which is higher than server side.
It is more of a sanity test.

Comment by auto [ 02/Mar/11 ]

Author:

{u'login': u'agirbal', u'name': u'agirbal', u'email': u'antoine@10gen.com'}

Message: JAVA-289: driver does not allow doc sizes matching the server limit, for both insert and find
https://github.com/mongodb/mongo-java-driver/commit/a74335490ecff178589627e6ee4d157933607bf8

Generated at Thu Feb 08 08:51:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.