GetLastError on sharded cluster can report incorrect result

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.2.3, 2.3.2
    • Affects Version/s: 1.8.3, 2.2.0, 2.2.1
    • Component/s: Write Ops
    • Environment:
    • Fully Compatible
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      Steps:

      1. Insert object into shard (successfully)
      2. Update object by _id (WriteResult writeResult = dbCollection.update(query, update, false, false, WriteConcern.SAFE)
      query looks like: {_id : XYZ}
      update looks like: {$set : {foo : bar, foo2 : bar2}}
      3. Object is updated

      WriteResult:

      { 
         writeResult =   { 
            "serverUsed":"127.0.0.1:27017/myDB", 
            "singleShard":"ReplSet3/ec2-xxxx.compute-1.amazonaws.com:27018,ec2-xxxx.compute-1.amazonaws.com:27018,ec2-xxxx.compute-1.amazonaws.com:27018", 
      =>    "n":0, 
            "lastOp":5686019109100191745, 
            "connectionId":1524, 
            "err":null, 
            "ok":1.0, 
      =>    "updatedExisting":true, 
            "wtime":0, 
            "writebackGLE": { 
               "singleShard":"ReplSet3/ec2-xxxx.compute-1.amazonaws.com:27018,ec2-xxxx.compute-1.amazonaws.com:27018,ec2-xxxx.comput1.amazonaws.com:27018", 
               "n":0, 
               "lastOp":5686019109100191745, 
               "connectionId":1524, 
               "err":null, 
               "ok":1.0 
            }, 
            "initialGLEHost":"ReplSet1/ec2-xxxx.compute-1.amazonaws.com:27018,ec2-xxxx.compute-1.amazonaws.com:27018,ec2-xxxx.compute1.amazonaws.com:27018" 
         } 
      

      This is very hard to reproduce since it is very intermittent. Maybe somebody has an vague idea about the exact situation when this might occur. One thing to note is that step 1 and 2 are executed very quickly.

      I had created a thread in the forum: http://groups.google.com/group/mongodb-user/browse_thread/thread/d1ca7e977dc7455b/973cab27e21df385?lnk=gst&q=smigfu#973cab27e21df385

        1. noUpdateButN1.js
          2 kB
        2. noUpdateButN1inAnotherCollection.js
          2 kB
        3. shTest.js
          2 kB

            Assignee:
            Eliot Horowitz (Inactive)
            Reporter:
            Philipp Marx
            Votes:
            3 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated:
              Resolved: