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

Prevent cleanupOrphan from deleting migrating chunk data before commit

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.2.8
    • Affects Version/s: None
    • Component/s: Sharding
    • Labels:
    • Fully Compatible
    • ALL
    • v3.0
    • Sharding 15 (06/03/16), Sharding 16 (06/24/16)

      cleanupOrphaned can be called between
      MigrationSourceManager::enterCriticalSection and
      MigrationSourceManager::commitDonateChunk. The _uncommittedMetadata variable is create and saved in MigrationSourceManager::enterCriticalSection, but the actual commit doesn't happen until MigrationSourceManager::commitDonateChunk is finished. cleanupOrphaned can sneak in between and use the _uncommittedMetadata saved state to decide the not yet committed chunk – which can still fail to be committed, thus we end up keeping the chunk data – is gone and then delete all the data.

      The master fix is going in as a result of SERVER-22659 – the commit to remove the _uncommittedMetadata variable. It needs to be backported, and modified if necessary.

            dianna.hohensee@mongodb.com Dianna Hohensee (Inactive)
            dianna.hohensee@mongodb.com Dianna Hohensee (Inactive)
            0 Vote for this issue
            3 Start watching this issue