Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-7958

GLE on sharded cluster can return previous operation's lastError

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.2.2, 2.3.1
    • Fix Version/s: 2.2.3, 2.3.2
    • Component/s: Sharding, Write Ops
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      see attached.

      Show
      see attached.

      Description

      In some situations migration that happens between two operations can cause first operation's GLE result to be returned to GLE call after second operation.

      Running attached js file like so (omitting startup and shutdown lines):
      mongo --nodb dupBad2.js | grep -v "^ m39" | grep -v "^ m30"

      Number of successful updates on node: 0


      successful update on node on A
      n=0,
      updatedExisting=true,
      err=E11000 duplicate key error index: test.trans.$owner_1 dup key: { : 1234567890 }



      successful update on node on B
      n=0,
      updatedExisting=true,
      err=E11000 duplicate key error index: test.trans.$owner_1 dup key: { : 1234567890 }


      Number of successful updates on node: 2

        Attachments

        1. dupBad1.js
          2 kB
        2. dupBad2.js
          4 kB
        3. dupBadAssert.js
          4 kB
        4. dupBadAssert.js
          4 kB

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: