diff options
author | Randolph Tan <randolph@10gen.com> | 2018-01-25 15:17:39 -0500 |
---|---|---|
committer | Randolph Tan <randolph@10gen.com> | 2018-01-29 16:50:48 -0500 |
commit | d16ce76f69687e34f06eb6db298fa4445d8105dc (patch) | |
tree | 2feab3dcef65e2023c2af78f8417fa58544ac95e /src/mongo/db | |
parent | 494dbd00897e82e786c21bb37c5048bc4b8beadb (diff) | |
download | mongo-d16ce76f69687e34f06eb6db298fa4445d8105dc.tar.gz |
SERVER-32556 retryable write on local db hits an invariant
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/repl/oplog.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mongo/db/repl/oplog.cpp b/src/mongo/db/repl/oplog.cpp index 4d52075cffa..127665345f5 100644 --- a/src/mongo/db/repl/oplog.cpp +++ b/src/mongo/db/repl/oplog.cpp @@ -420,7 +420,10 @@ OpTime logOp(OperationContext* opCtx, // For commands, the test below is on the command ns and therefore does not check for // specific namespaces such as system.profile. This is the caller's responsibility. if (replCoord->isOplogDisabledFor(opCtx, nss)) { - invariant(statementId == kUninitializedStmtId); + uassert(ErrorCodes::IllegalOperation, + str::stream() << "retryable writes is not supported for unreplicated ns: " + << nss.ns(), + statementId == kUninitializedStmtId); return {}; } @@ -464,7 +467,10 @@ std::vector<OpTime> logInsertOps(OperationContext* opCtx, auto replCoord = ReplicationCoordinator::get(opCtx); if (replCoord->isOplogDisabledFor(opCtx, nss)) { - invariant(begin->stmtId == kUninitializedStmtId); + uassert(ErrorCodes::IllegalOperation, + str::stream() << "retryable writes is not supported for unreplicated ns: " + << nss.ns(), + begin->stmtId == kUninitializedStmtId); return {}; } |