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

Refactor and improve applyChunkOpsDeprecated

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Sharding

      The CommitChunkMigration command will be calling the applyOps command. Its needs are not met by the current applyChunkOpsDeprecated, which expects a precondition and adds a majority write concern by default.

      Two changes:
      1) Refactor applyChunkOpsDeprecated so CommitChunkMigration can use it.
      2) Swap this command failure check catalog_manager_replica_set.cpp#L1597-L1636 with the more robust check here migration_source_manager.cpp#L382-L451

      The second change will make sure applyChunkOpsDeprecated refreshes to the latest optime before querying the config.chunks collection. This way it knows to wait for the applyOps writes, and won't potentially miss them if they haven't propagated to a secondary by the time of the query to check on them. Using refreshMetadataNow allows us to check that the metadata was updated by the absence of the old chunk metadata, rather than requiring us to know what the new chunk metadata is, which will be unknown for moveChunk, since the config server generates it via CommitChunkMigration command, and should give merge and split more flexibility for future changes as well.

            Assignee:
            backlog-server-sharding [DO NOT USE] Backlog - Sharding Team
            Reporter:
            dianna.hohensee@mongodb.com Dianna Hohensee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: