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 19:54:41 +0000
commit9f22227b1f0c89a45bd617bf1451678bde9af426 (patch)
treee1318c07a86cb6680603811028ce217792aeee2c
parent62500b7d0c8ae644916fcd13573a6bcb63e80d8c (diff)
downloadmongo-9f22227b1f0c89a45bd617bf1451678bde9af426.tar.gz
SERVER-48078 Remove OpDebug invariant that relies on monotonic clock source
(cherry picked from commit c2479d57f11528846cd4b87cd62cd75e5e2eebfc)
-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 f4d07ad5f29..b5b0394320f 100644
--- a/src/mongo/db/curop.h
+++ b/src/mongo/db/curop.h
@@ -552,8 +552,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;
}