summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/migration_destination_manager.cpp
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2020-11-03 12:42:38 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-11-13 20:15:34 +0000
commit8f9823f644d0b6beba8a301866141a578d278534 (patch)
tree1ef4bc439da93a2b39cff7c96a975668c27e7070 /src/mongo/db/s/migration_destination_manager.cpp
parentb670258ac185ecea0492c742f2f50da9d8ab618f (diff)
downloadmongo-8f9823f644d0b6beba8a301866141a578d278534.tar.gz
SERVER-52556 Versioned CollectionCatalog. Writes are performed using copy-on-write.
Internal mutexes when reading CollectionCatalog are removed, just one mutex for writes are needed. Lock-free reads helper AutoGetCollectionForReadLockFree stashes a CollectionCatalog consistent with snapshot on OperationContext
Diffstat (limited to 'src/mongo/db/s/migration_destination_manager.cpp')
-rw-r--r--src/mongo/db/s/migration_destination_manager.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/s/migration_destination_manager.cpp b/src/mongo/db/s/migration_destination_manager.cpp
index 2955886c127..8d42b161ddc 100644
--- a/src/mongo/db/s/migration_destination_manager.cpp
+++ b/src/mongo/db/s/migration_destination_manager.cpp
@@ -817,7 +817,7 @@ void MigrationDestinationManager::cloneCollectionIndexesAndOptions(
AutoGetOrCreateDb autoCreateDb(opCtx, nss.db(), MODE_X);
auto db = autoCreateDb.getDb();
- auto collection = CollectionCatalog::get(opCtx).lookupCollectionByNamespace(opCtx, nss);
+ auto collection = CollectionCatalog::get(opCtx)->lookupCollectionByNamespace(opCtx, nss);
if (collection) {
checkUUIDsMatch(collection);
} else {
@@ -834,7 +834,7 @@ void MigrationDestinationManager::cloneCollectionIndexesAndOptions(
createDefaultIndexes,
collectionOptionsAndIndexes.idIndexSpec));
wuow.commit();
- collection = CollectionCatalog::get(opCtx).lookupCollectionByNamespace(opCtx, nss);
+ collection = CollectionCatalog::get(opCtx)->lookupCollectionByNamespace(opCtx, nss);
}
auto indexSpecs = checkEmptyOrGetMissingIndexesFromDonor(collection);