diff options
author | Jack Mulrow <jack.mulrow@mongodb.com> | 2018-10-31 17:05:37 -0400 |
---|---|---|
committer | Jack Mulrow <jack.mulrow@mongodb.com> | 2018-11-01 14:25:48 -0400 |
commit | b31e8fd295abde81246d153d4c141f83b0a33db6 (patch) | |
tree | 9869233a364ebd0120394f87fa7010bcf3d5204e | |
parent | f68d6091bad5a2747cc09c743b8c2c7b4e42a65a (diff) | |
download | mongo-b31e8fd295abde81246d153d4c141f83b0a33db6.tar.gz |
SERVER-37693 Uassert shards never return CannotImplicitlyCreateCollection in a transaction
-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; |