diff options
author | Sviatlana Zuiko <sviatlana.zuiko@mongodb.com> | 2023-03-31 14:55:00 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-03-31 17:16:28 +0000 |
commit | 38bd6258b2dcd736cf21fdeca90a4ec1a5ea7cc4 (patch) | |
tree | b79d6f48cd25b09efcc5578a79178c4e3ae4605a /src/mongo/db/storage | |
parent | c327966123691594c62c796dbca2e490e2545e59 (diff) | |
download | mongo-38bd6258b2dcd736cf21fdeca90a4ec1a5ea7cc4.tar.gz |
Revert "SERVER-74749 Integrate truncate markers deletion with change collections"
This reverts commit 895bf32b781751e6567fe91068f29787b31ebfd9.
Diffstat (limited to 'src/mongo/db/storage')
-rw-r--r-- | src/mongo/db/storage/collection_markers.cpp | 5 | ||||
-rw-r--r-- | src/mongo/db/storage/collection_markers.h | 7 |
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; |