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

applyChunkOpsDeprecated retries and throws an error on preCondition no longer matching because the original write worked

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2.4, 3.3.3
    • Component/s: Sharding
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Completed:
    • Sprint:
      Sharding 10 (02/19/16), Sharding 11 (03/11/16)
    • Linked BF Score:
      0

      Description

      If the applyChunkOpsDeprecated's applyOps write works, but doesn't send back OK, it will retry. However, because the first write worked, the precondition does not match and it returns an error. applyChunkOpsDeprecated should double check whether the chunk changes did actually make it into the oplog, and if so return success.

      moveChunk already deals with this issue, but splitChunk and mergeChunk do not. ChunkMoveOperationState::commitMigration looks at the result of applyChunkOpsDeprecated and if there's an error reloads the chunk information from the oplog and checks to see if the new version number is there – if so, it succeeded.

      Potential solution:
      add a parameter (ChunkType?) to applyChunkOpsDeprecated that holds the last chunk and chunk version of the ops being applied by applyOps. Move the applyOpsStatus logic in ChunkMoveOperationState::commitMigration into applyChunkOpsDeprecated and generalize it to handle move/split/merge versioning checks.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: