diff options
author | Louis Williams <louis.williams@mongodb.com> | 2019-06-07 16:22:45 -0400 |
---|---|---|
committer | Louis Williams <louis.williams@mongodb.com> | 2019-06-07 16:23:14 -0400 |
commit | c75dce32fa936f4e2b4a89a566007d4404a232dc (patch) | |
tree | f570c0e8e4710f0a2a2dff205e848e94071a3b37 | |
parent | 5ca5038f731819dbeea5163a3932665e25ab3cd5 (diff) | |
download | mongo-c75dce32fa936f4e2b4a89a566007d4404a232dc.tar.gz |
SERVER-41477 The invariant that hybrid index writes recorded matches the number applied should be debug-only
-rw-r--r-- | src/mongo/db/index/index_build_interceptor.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mongo/db/index/index_build_interceptor.cpp b/src/mongo/db/index/index_build_interceptor.cpp index d75fa9ab3a0..aaf57c66564 100644 --- a/src/mongo/db/index/index_build_interceptor.cpp +++ b/src/mongo/db/index/index_build_interceptor.cpp @@ -338,12 +338,15 @@ bool IndexBuildInterceptor::areAllWritesApplied(OperationContext* opCtx) const { // The table is empty only when all writes are applied. if (!record) { auto writesRecorded = _sideWritesCounter.load(); - invariant(writesRecorded == _numApplied, - str::stream() << "The number of side writes recorded does not match the number " - "applied, despite the table appearing empty. Writes recorded: " - << writesRecorded - << ", applied: " - << _numApplied); + if (writesRecorded != _numApplied) { + const std::string message = str::stream() + << "The number of side writes recorded does not match the number " + "applied, despite the table appearing empty. Writes recorded: " + << writesRecorded << ", applied: " << _numApplied; + + dassert(writesRecorded == _numApplied, message); + warning() << message; + } return true; } |