In drain mode, drop all config locks:
// Free any leftover locks from previous instantiations
auto distLockManager = Grid::get(txn)->catalogClient(txn)->getDistLockManager();
distLockManager->unlockAll(txn, distLockManager->getProcessID());
and reacquire distlocks for all the the collections that have migration documents in config.migrations. Lock the distlocks with clusterId so that the balancer code can overtake the locks (because it uses clusterId as a lock session ID).
----------------
This is to cover the case – which 'technically' should never happen – where the config.migrations collection doesn't match with all the config.locks docs held by the balancer when a new primary is elected.
- depends on
-
SERVER-26013 Add means to the DistLockManager to restore locks during draining mode
- Closed
- related to
-
SERVER-26222 MigrationManager::_abandonActiveMigrationsAndEnableManager can be called in state kStopping
- Closed