summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorLouis Williams <louis.williams@mongodb.com>2019-06-07 16:22:45 -0400
committerLouis Williams <louis.williams@mongodb.com>2019-06-07 16:23:14 -0400
commitc75dce32fa936f4e2b4a89a566007d4404a232dc (patch)
treef570c0e8e4710f0a2a2dff205e848e94071a3b37 /src/mongo/db
parent5ca5038f731819dbeea5163a3932665e25ab3cd5 (diff)
downloadmongo-c75dce32fa936f4e2b4a89a566007d4404a232dc.tar.gz
SERVER-41477 The invariant that hybrid index writes recorded matches the number applied should be debug-only
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/index/index_build_interceptor.cpp15
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;
}