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

Chunk Migration migrates the session history for the migrating session leading to a deadlock

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0, 7.0.0-rc1
    • Affects Version/s: None
    • Component/s: None
    • None
    • Sharding NYC
    • Fully Compatible
    • ALL
    • v7.0
    • Sharding NYC 2023-05-15
    • 145

      The chunkMigration protocol always migrates the oplog entries for $incompleteOplogHistory noop oplog entry irrespective of if:-
      1. Its from the same namespace that it is migrating
      2. Belongs to the chunk Range

      Steps while migrating oplogs
      1. The SessionCatalogMigrationSource tries to traverse the oplog chain for every session that exists on the donor
      2. The SessionCatalogMigrationSource generates a $incompleteOplogHistory noop oplog entry for every transaction that it cannot find the next oplog entry for (here), for example, because of oplog truncation.
      3. The SessionCatalogMigrationSource doesn't filter out $incompleteOplogHistory noop oplog entries (i.e. the namespace and chunk range check doesn't apply).

      The Receiving shard always checksout the session it is migrating.

      And then, as part of migrating oplogs, we also checkout the session that is being migrated and since the session is already checkedout, it causes a server hang here

      This seems to be violating the assumption that chunk migration protocol could never migrate session it is migrating (due to how incomplete session history is handled)

            Assignee:
            randolph@mongodb.com Randolph Tan
            Reporter:
            rachita.dhawan@mongodb.com Rachita Dhawan
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: