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

Include alwayUpsert: false in applyOps commands in sharding_catalog_manager_chunk_operations.cpp

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.7.0
    • Component/s: Sharding
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Sharding 2020-05-04

      Description

      Currently, the applyOps command for chunk operations doesn't include the optional alwaysUpsert field. It turns out that this field defaults to true inside the applyOps command, and that the "b" field for each individual operation can be overwritten by it. So if the oplog entry has an incorrect "o2" query field, we can end up trying to insert a new chunk doc instead of updating the existing doc in which case the chunk operation will fail with DuplicateKey error (see this test). 

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              cheahuychou.mao Cheahuychou Mao
              Reporter:
              cheahuychou.mao Cheahuychou Mao
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: