diff options
Diffstat (limited to 'src/mongo/db')
-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; } |