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

    • Fully Compatible
    • ALL
    • Sharding 2020-05-04

      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). 

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

              Created:
              Updated:
              Resolved: