Shards: getLastError waits 1 second to respond after insert with invalid shard key

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.2.0-rc1
    • Affects Version/s: 2.1.2
    • Component/s: Sharding
    • None
    • Environment:
      osx 10.7.4
    • OS X
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      With a sharded setup, enable sharding on a collection:

      > db.runCommand( { shardcollection : "test.testshard", key :

      { name : 1, age: 1 }

      } )
      > use test
      > db.testshard.insert(

      { age: 1 }

      )

        • Actual behavior:

      ... one second later ...

      "tried to insert object with no valid shard key for

      { name: 1.0, age: 1.0 }

      :

      { _id: ObjectId('4ff1ecd2118f035ab2938dad'), age: 1.0 }

      "

        • Expected behavior:

      The error message should respond immediately.

      These delays "stack up"; e.g. for each invalid document inserted, the delayed response increases by one second. So, with a nodejs program, 6 parallel inserts (followed by getLastError) means waiting for 6 seconds to get the error response.

            Assignee:
            Greg Studer (Inactive)
            Reporter:
            Aaron Heckmann (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: