diff options
author | Blake Oler <blake.oler@mongodb.com> | 2019-02-11 16:25:46 -0500 |
---|---|---|
committer | Blake Oler <blake.oler@mongodb.com> | 2019-02-12 11:12:15 -0500 |
commit | 9d06566d7f8c9affbadd2bb9c54bb94457863dd0 (patch) | |
tree | 6d07c586238ceea8f578507348a4932ddb016ca1 | |
parent | 1760b0f15343050158742ecbc1ab6ece9e75b5d9 (diff) | |
download | mongo-9d06566d7f8c9affbadd2bb9c54bb94457863dd0.tar.gz |
SERVER-38344 Hold database distlocks during migration and split
-rw-r--r-- | src/mongo/db/s/config/configsvr_shard_collection_command.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mongo/db/s/config/configsvr_shard_collection_command.cpp b/src/mongo/db/s/config/configsvr_shard_collection_command.cpp index 64b2249fbfb..a42e0b87659 100644 --- a/src/mongo/db/s/config/configsvr_shard_collection_command.cpp +++ b/src/mongo/db/s/config/configsvr_shard_collection_command.cpp @@ -895,15 +895,17 @@ public: // Make sure the cached metadata for the collection knows that we are now sharded catalogCache->invalidateShardedCollection(nss); - // Free the distlocks to allow the splits and migrations below to proceed. + // Free the collection distlock to allow the splits and migrations below to proceed. These + // operations do not take the database distlocks. collDistLock.reset(); - dbDistLock.reset(); - backwardsCompatibleDbDistLock.reset(); // Step 7. Migrate initial chunks to distribute them across shards. migrateAndFurtherSplitInitialChunks( opCtx, nss, numShards, shardIds, isEmpty, shardKeyPattern, allSplits); + dbDistLock.reset(); + backwardsCompatibleDbDistLock.reset(); + return true; } |