summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/storage')
-rw-r--r--src/mongo/db/storage/collection_markers.cpp5
-rw-r--r--src/mongo/db/storage/collection_markers.h7
2 files changed, 7 insertions, 5 deletions
diff --git a/src/mongo/db/storage/collection_markers.cpp b/src/mongo/db/storage/collection_markers.cpp
index 76d9157aca3..debc696bc60 100644
--- a/src/mongo/db/storage/collection_markers.cpp
+++ b/src/mongo/db/storage/collection_markers.cpp
@@ -159,6 +159,7 @@ void CollectionTruncateMarkers::createNewMarkerIfNeeded(OperationContext* opCtx,
pokeReclaimThread(opCtx);
}
+
void CollectionTruncateMarkers::updateCurrentMarkerAfterInsertOnCommit(
OperationContext* opCtx,
int64_t bytesInserted,
@@ -510,7 +511,7 @@ void CollectionTruncateMarkersWithPartialExpiration::updateCurrentMarkerAfterIns
// will happen after the marker has been created. This guarantees that the metrics
// will eventually be correct as long as the expiration criteria checks for the
// metrics and the highest marker expiration.
- collectionMarkers->updateHighestSeenRecordIdAndWallTime(recordId, wallTime);
+ collectionMarkers->_replaceNewHighestMarkingIfNecessary(recordId, wallTime);
collectionMarkers->_currentRecords.addAndFetch(countInserted);
int64_t newCurrentBytes = collectionMarkers->_currentBytes.addAndFetch(bytesInserted);
if (wallTime != Date_t() && newCurrentBytes >= collectionMarkers->_minBytesPerMarker) {
@@ -570,7 +571,7 @@ void CollectionTruncateMarkersWithPartialExpiration::createPartialMarkerIfNecess
}
}
-void CollectionTruncateMarkersWithPartialExpiration::updateHighestSeenRecordIdAndWallTime(
+void CollectionTruncateMarkersWithPartialExpiration::_replaceNewHighestMarkingIfNecessary(
const RecordId& rId, Date_t wallTime) {
stdx::unique_lock lk(_lastHighestRecordMutex);
_lastHighestRecordId = std::max(_lastHighestRecordId, rId);
diff --git a/src/mongo/db/storage/collection_markers.h b/src/mongo/db/storage/collection_markers.h
index 588ccd20d0a..05ce2590918 100644
--- a/src/mongo/db/storage/collection_markers.h
+++ b/src/mongo/db/storage/collection_markers.h
@@ -277,9 +277,6 @@ public:
Date_t wallTime,
int64_t countInserted) final;
- // Updates the highest seen RecordId and wall time if they are above the current ones.
- void updateHighestSeenRecordIdAndWallTime(const RecordId& rId, Date_t wallTime);
-
private:
// Highest marker seen during the lifetime of the class. Modifications must happen
// while holding '_lastHighestRecordMutex'.
@@ -288,6 +285,10 @@ private:
RecordId _lastHighestRecordId;
Date_t _lastHighestWallTime;
+ // Replaces the highest marker if _isMarkerLargerThanHighest returns true.
+ void _replaceNewHighestMarkingIfNecessary(const RecordId& newMarkerRecordId,
+ Date_t newMarkerWallTime);
+
// Used to decide if the current partially built marker has expired.
virtual bool _hasPartialMarkerExpired(OperationContext* opCtx) const {
return false;