Duplicate-key race during jumbo migrations when balancing with "attemptToBalanceJumboChunks:true"

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Cluster Scalability
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      SERVER-116528 addressed a race in balancer-initiated force-jumbo migrations during shard draining. When the jumbo migration path uses an index scan, concurrent shard-key updates can cause the same document to be cloned twice, resulting in duplicate _id errors on the recipient shard and an aborted migration. That mitigation was intentionally limited to shard-draining migrations because repeated failures could prevent removeShard from making progress. Normal-balancing force-jumbo migrations were not addressed.

      During normal data-imbalance balancing with "attemptToBalanceJumboChunks:true", the balancer can still invoke the force-jumbo path for large chunks, making it vulnerable to the same duplicate-key race. 

      Two possible solutions:

      • The balancer should not automatically attempt migrations of jumbo chunks.
      • A more comprehensive fix would allow automatic jumbo migrations to proceed safely by entering the critical section before cloning, as manual forceJumbo migrations do. 

            Assignee:
            Unassigned
            Reporter:
            Kruti Shah
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: