Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-556

Wrong exception on too large query when Mongo object is not reused

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.0.0
    • 2.7.2
    • Cluster Management
    • None
    • Linux 64 Bit

    Description

      I'm using the Java driver v2.7.2 to query a sharded system consisting of 4 shards, each 3 replicas, running linux-mongodb-v2.0.1, v2.0.2 and v2.0.4. All mongos are running v2.0.1.

      The query I'm executing is of this type:
      {_id:{$in:[1,2,3,4]}}

      When the inlist becomes too big (more than 265,000 id's in my case), I get the following exception, where max BSON size is greater than 2.6 times of the DBObject size:

      Exception in thread "main" com.mongodb.MongoInternalException:
      DBObject of size 6442515 is over Max BSON size 16777216
      at com.mongodb.OutMessage.putObject(OutMessage.java:147)
      at com.mongodb.OutMessage._appendQuery(OutMessage.java:85)
      at com.mongodb.OutMessage.query(OutMessage.java:44)
      at com.mongodb.OutMessage.query(OutMessage.java:38)
      at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:303)
      at com.mongodb.DBCursor._check(DBCursor.java:369)
      at com.mongodb.DBCursor._hasNext(DBCursor.java:498)
      at com.mongodb.DBCursor.hasNext(DBCursor.java:523)

      When I reuse the mongo object, I don't get the exception. Moreover, I can put up to 995,000 id's into the list without any problem.
      Exceeding the inlist size results in an appropriate exception:

      Exception in thread "main" com.mongodb.MongoException: could not
      initialize cursor across all shards because : combinatorial limit of
      $in partitioning of result set exceeded @ offerStoreDE4/
      s115:27018,s132:27018,s125:27018
      at com.mongodb.MongoException.parse(MongoException.java:82)
      at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:312)
      at com.mongodb.DBCursor._check(DBCursor.java:369)
      at com.mongodb.DBCursor._hasNext(DBCursor.java:498)
      at com.mongodb.DBCursor.hasNext(DBCursor.java:523)

      However, when it's the first usage of the Mongo object then it's not yet reused and will fail as described above.

      For more details, please see:
      http://groups.google.com/group/mongodb-user/browse_thread/thread/3b96668396f0f9d4

      Attachments

        Activity

          People

            Unassigned Unassigned
            kay.agahd@idealo.de Kay Agahd
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: