diff options
author | Lingzhi Deng <lingzhi.deng@mongodb.com> | 2020-05-04 20:15:44 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-05-07 19:41:52 +0000 |
commit | db37687407c8f84f42afa87ba0d0c14bcbf35140 (patch) | |
tree | eb19ba52e4c7067b13970ac600f8a4733f9aeacc /src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp | |
parent | 049b10ad31be3233130dbf4313b6be4a3ecd47c9 (diff) | |
download | mongo-db37687407c8f84f42afa87ba0d0c14bcbf35140.tar.gz |
SERVER-47672: Add minSnapshotHistoryWindowInSeconds and remove snapshot window adjustment logic
Diffstat (limited to 'src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp')
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp index 922ff6e1f6c..fc0f17ffa26 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp @@ -764,7 +764,7 @@ WiredTigerKVEngine::WiredTigerKVEngine(const std::string& canonicalName, // We do not maintain any snapshot history for the ephemeral storage engine in production // because replication and sharded transactions do not currently run on the inMemory engine. // It is live in testing, however. - snapshotWindowParams.targetSnapshotHistoryWindowInSeconds.store(0); + snapshotWindowParams.minSnapshotHistoryWindowInSeconds.store(0); } _sizeStorerUri = _uri("sizeStorer"); @@ -1861,7 +1861,7 @@ void WiredTigerKVEngine::setOldestTimestampFromStable() { } // Calculate what the oldest_timestamp should be from the stable_timestamp. The oldest - // timestamp should lag behind stable by 'targetSnapshotHistoryWindowInSeconds' to create a + // timestamp should lag behind stable by 'minSnapshotHistoryWindowInSeconds' to create a // window of available snapshots. If the lag window is not yet large enough, we will not // update/forward the oldest_timestamp yet and instead return early. Timestamp newOldestTimestamp = _calculateHistoryLagFromStableTimestamp(stableTimestamp); @@ -1904,23 +1904,23 @@ void WiredTigerKVEngine::setOldestTimestamp(Timestamp newOldestTimestamp, bool f Timestamp WiredTigerKVEngine::_calculateHistoryLagFromStableTimestamp(Timestamp stableTimestamp) { // The oldest_timestamp should lag behind the stable_timestamp by - // 'targetSnapshotHistoryWindowInSeconds' seconds. + // 'minSnapshotHistoryWindowInSeconds' seconds. if (_ephemeral && !getTestCommandsEnabled()) { // No history should be maintained for the inMemory engine because it is not used yet. - invariant(snapshotWindowParams.targetSnapshotHistoryWindowInSeconds.load() == 0); + invariant(snapshotWindowParams.minSnapshotHistoryWindowInSeconds.load() == 0); } if (stableTimestamp.getSecs() < - static_cast<unsigned>(snapshotWindowParams.targetSnapshotHistoryWindowInSeconds.load())) { + static_cast<unsigned>(snapshotWindowParams.minSnapshotHistoryWindowInSeconds.load())) { // The history window is larger than the timestamp history thus far. We must wait for - // the history to reach the window size before moving oldest_timestamp forward. + // the history to reach the window size before moving oldest_timestamp forward. This should + // only happen in unit tests. return Timestamp(); } Timestamp calculatedOldestTimestamp( - stableTimestamp.getSecs() - - snapshotWindowParams.targetSnapshotHistoryWindowInSeconds.load(), + stableTimestamp.getSecs() - snapshotWindowParams.minSnapshotHistoryWindowInSeconds.load(), stableTimestamp.getInc()); if (calculatedOldestTimestamp.asULL() <= _oldestTimestamp.load()) { |