summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog_raii.cpp
diff options
context:
space:
mode:
authorBrett Nawrocki <brett.nawrocki@mongodb.com>2021-09-16 20:28:58 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-09-21 22:10:12 +0000
commit31f1068f5273f1dd55378eda3fb4bdc441e0a15e (patch)
tree534b79539507bfc77a9f3e523b44880fca9318a0 /src/mongo/db/catalog_raii.cpp
parent14b059e544578774d7f7ee3aacdc6ac47a15bb4c (diff)
downloadmongo-31f1068f5273f1dd55378eda3fb4bdc441e0a15e.tar.gz
SERVER-60094 Add shard version to internal write
ReshardingOplogApplicationRules::_applyDelete_inlock() has special logic to, upon removing a document from the temporary resharding collection, move a document from one of the other stash collections (i.e. one associated with a different donor shard) into its place. The runWithTransaction() helper does so by using AlternativeSessionRegion which will construct a separate OperationContext. The write being performed in this separate OperationContext won't have shard version attached for the temporary resharding collection like the original one had. Therefore, call initializeClientRoutingVersions() on this context to set the version.
Diffstat (limited to 'src/mongo/db/catalog_raii.cpp')
-rw-r--r--src/mongo/db/catalog_raii.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/mongo/db/catalog_raii.cpp b/src/mongo/db/catalog_raii.cpp
index bc21e6a5ef8..77f71f6d822 100644
--- a/src/mongo/db/catalog_raii.cpp
+++ b/src/mongo/db/catalog_raii.cpp
@@ -131,8 +131,7 @@ AutoGetCollection::AutoGetCollection(OperationContext* opCtx,
_coll = catalog->lookupCollectionByNamespace(opCtx, _resolvedNss);
invariant(!nsOrUUID.uuid() || _coll,
str::stream() << "Collection for " << _resolvedNss.ns()
- << " disappeared after successufully resolving "
- << nsOrUUID.toString());
+ << " disappeared after successfully resolving " << nsOrUUID.toString());
if (_coll) {
// If we are in a transaction, we cannot yield and wait when there are pending catalog