diff options
-rw-r--r-- | jstests/replsets/libs/apply_ops_concurrent_non_atomic.js | 5 | ||||
-rw-r--r-- | src/mongo/db/stats/counters.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/stats/counters.h | 24 |
3 files changed, 16 insertions, 15 deletions
diff --git a/jstests/replsets/libs/apply_ops_concurrent_non_atomic.js b/jstests/replsets/libs/apply_ops_concurrent_non_atomic.js index 39dcfdf80da..97de2677de5 100644 --- a/jstests/replsets/libs/apply_ops_concurrent_non_atomic.js +++ b/jstests/replsets/libs/apply_ops_concurrent_non_atomic.js @@ -193,7 +193,8 @@ var ApplyOpsConcurrentNonAtomicTest = function(options) { // holding the global lock, the insert opcounter will eventually be incremented to 2. try { let insertOpCount = 0; - const expectedFinalOpCount = 2; + // Expecting two HMAC inserts and two applyOps in-progress. + const expectedFinalOpCount = 4; assert.soon( function() { const serverStatus = adminDb.serverStatus(); @@ -206,7 +207,7 @@ var ApplyOpsConcurrentNonAtomicTest = function(options) { 'Expected at most ' + expectedFinalOpCount + ' documents inserted with fail point enabled. ' + 'Most recent insert operation count = ' + insertOpCount); - return insertOpCount === expectedFinalOpCount; + return insertOpCount == expectedFinalOpCount; }, 'Insert operation count did not reach ' + expectedFinalOpCount + ' as expected with fail point enabled. Most recent insert operation count = ' + diff --git a/src/mongo/db/stats/counters.cpp b/src/mongo/db/stats/counters.cpp index af695566316..81a77016a8b 100644 --- a/src/mongo/db/stats/counters.cpp +++ b/src/mongo/db/stats/counters.cpp @@ -109,7 +109,7 @@ void OpCounters::gotOp(int op, bool isCommand) { } void OpCounters::_checkWrap() { - const unsigned MAX = 1 << 30; + const int64_t MAX = 1ULL << 60; bool wrap = _insert.loadRelaxed() > MAX || _query.loadRelaxed() > MAX || _update.loadRelaxed() > MAX || _delete.loadRelaxed() > MAX || diff --git a/src/mongo/db/stats/counters.h b/src/mongo/db/stats/counters.h index e9742797100..07e38b251a9 100644 --- a/src/mongo/db/stats/counters.h +++ b/src/mongo/db/stats/counters.h @@ -61,34 +61,34 @@ public: BSONObj getObj() const; // thse are used by snmp, and other things, do not remove - const AtomicUInt32* getInsert() const { + const AtomicInt64* getInsert() const { return &_insert; } - const AtomicUInt32* getQuery() const { + const AtomicInt64* getQuery() const { return &_query; } - const AtomicUInt32* getUpdate() const { + const AtomicInt64* getUpdate() const { return &_update; } - const AtomicUInt32* getDelete() const { + const AtomicInt64* getDelete() const { return &_delete; } - const AtomicUInt32* getGetMore() const { + const AtomicInt64* getGetMore() const { return &_getmore; } - const AtomicUInt32* getCommand() const { + const AtomicInt64* getCommand() const { return &_command; } private: void _checkWrap(); - CacheAligned<AtomicUInt32> _insert; - CacheAligned<AtomicUInt32> _query; - CacheAligned<AtomicUInt32> _update; - CacheAligned<AtomicUInt32> _delete; - CacheAligned<AtomicUInt32> _getmore; - CacheAligned<AtomicUInt32> _command; + CacheAligned<AtomicInt64> _insert; + CacheAligned<AtomicInt64> _query; + CacheAligned<AtomicInt64> _update; + CacheAligned<AtomicInt64> _delete; + CacheAligned<AtomicInt64> _getmore; + CacheAligned<AtomicInt64> _command; }; extern OpCounters globalOpCounters; |