summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/biggie/biggie_record_store.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/storage/biggie/biggie_record_store.h')
-rw-r--r--src/mongo/db/storage/biggie/biggie_record_store.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mongo/db/storage/biggie/biggie_record_store.h b/src/mongo/db/storage/biggie/biggie_record_store.h
index b65cf933db2..bb0f6abbd75 100644
--- a/src/mongo/db/storage/biggie/biggie_record_store.h
+++ b/src/mongo/db/storage/biggie/biggie_record_store.h
@@ -112,12 +112,12 @@ public:
private:
friend class VisibilityManagerChange;
+ void _initHighestIdIfNeeded(OperationContext* opCtx);
+
/**
* This gets the next (guaranteed) unique record id.
*/
- inline int64_t _nextRecordId() {
- return _highestRecordId.fetchAndAdd(1);
- }
+ int64_t _nextRecordId(OperationContext* opCtx);
/**
* Two helper functions for deleting excess records in capped record stores.
@@ -142,7 +142,8 @@ private:
mutable Mutex _cappedDeleterMutex = MONGO_MAKE_LATCH("RecordStore::_cappedDeleterMutex");
- AtomicWord<long long> _highestRecordId{1};
+ mutable Mutex _initHighestIdMutex = MONGO_MAKE_LATCH("RecordStore::_initHighestIdMutex");
+ AtomicWord<long long> _highestRecordId{0};
AtomicWord<long long> _numRecords{0};
AtomicWord<long long> _dataSize{0};