diff options
Diffstat (limited to 'src/mongo/s/commands')
-rw-r--r-- | src/mongo/s/commands/strategy.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/s/commands/strategy.cpp b/src/mongo/s/commands/strategy.cpp index 0426f19d2bd..ee2581ab975 100644 --- a/src/mongo/s/commands/strategy.cpp +++ b/src/mongo/s/commands/strategy.cpp @@ -427,6 +427,14 @@ void runCommand(OperationContext* opCtx, return staleInfo->getNss(); } else if (auto implicitCreateInfo = ex.extraInfo<CannotImplicitlyCreateCollectionInfo>()) { + // Requests that attempt to implicitly create a collection in a transaction + // should always fail with OperationNotSupportedInTransaction - this + // assertion is only meant to safeguard that assumption. + uassert(50983, + str::stream() << "Cannot handle exception in a transaction: " + << ex.toStatus(), + !TransactionRouter::get(opCtx)); + return implicitCreateInfo->getNss(); } else { throw; |