diff options
author | Matthew Russotto <matthew.russotto@10gen.com> | 2018-04-03 12:12:12 -0400 |
---|---|---|
committer | Matthew Russotto <matthew.russotto@10gen.com> | 2018-04-05 10:49:12 -0400 |
commit | f6065636b7d16852bfa3b4d7ceb8c492948c9507 (patch) | |
tree | 8029c412fcfcf7e3ad816da194a48f8c9297650b /src | |
parent | 14776e84ade6cf39193f0fa9610b6259d64754b0 (diff) | |
download | mongo-f6065636b7d16852bfa3b4d7ceb8c492948c9507.tar.gz |
SERVER-33212 Support multi-updates in transactions.
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/ops/write_ops_exec.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/db/ops/write_ops_exec.cpp b/src/mongo/db/ops/write_ops_exec.cpp index 14f19426d01..7152285fc0f 100644 --- a/src/mongo/db/ops/write_ops_exec.cpp +++ b/src/mongo/db/ops/write_ops_exec.cpp @@ -567,9 +567,11 @@ static SingleWriteResult performSingleUpdateOp(OperationContext* opCtx, const NamespaceString& ns, StmtId stmtId, const write_ops::UpdateOpEntry& op) { + auto session = OperationContextSession::get(opCtx); uassert(ErrorCodes::InvalidOptions, "Cannot use (or request) retryable writes with multi=true", - !(opCtx->getTxnNumber() && op.getMulti())); + (session && session->inMultiDocumentTransaction()) || !opCtx->getTxnNumber() || + !op.getMulti()); globalOpCounters.gotUpdate(); auto& curOp = *CurOp::get(opCtx); |