summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Wahlin <james@mongodb.com>2020-05-11 09:47:25 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-05-11 17:25:46 +0000
commitc2479d57f11528846cd4b87cd62cd75e5e2eebfc (patch)
tree4eeab510c2881d54d13daaf62fbb401a8afb5c88
parentaf62a3eeaf0b1101cb2f6e8e7595b70f2fe2f10f (diff)
downloadmongo-c2479d57f11528846cd4b87cd62cd75e5e2eebfc.tar.gz
SERVER-48078 Remove OpDebug invariant that relies on monotonic clock source
-rw-r--r--src/mongo/db/curop.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/db/curop.h b/src/mongo/db/curop.h
index 6f0478c8cc7..54762580f79 100644
--- a/src/mongo/db/curop.h
+++ b/src/mongo/db/curop.h
@@ -556,8 +556,8 @@ public:
if (_debug.remoteOpWaitTime) {
Microseconds end = elapsedTimeTotal();
invariant(_remoteOpStartTime);
- invariant(*_remoteOpStartTime <= end);
- Microseconds delta = end - *_remoteOpStartTime;
+ // A backward shift of the realtime system clock could lead to a negative delta.
+ Microseconds delta = std::max((end - *_remoteOpStartTime), Microseconds{0});
*_debug.remoteOpWaitTime += delta;
_remoteOpStartTime = boost::none;
}