diff options
author | Dianna Hohensee <dianna.hohensee@10gen.com> | 2019-07-01 10:01:15 -0400 |
---|---|---|
committer | Dianna Hohensee <dianna.hohensee@10gen.com> | 2019-07-01 14:10:25 -0400 |
commit | 8bb53a07a5c593d85b6229a2afe096b3e1efe21d (patch) | |
tree | 8cf4cce2f88edd9256a08d2a6b9b6bfb1aea8cad /src/mongo/db/storage/devnull | |
parent | 8cb025148fb78311f97454894324419d1442ce08 (diff) | |
download | mongo-8bb53a07a5c593d85b6229a2afe096b3e1efe21d.tar.gz |
Revert "SERVER-36956 SnapshotTooOld errors will always increase the snapshot history window size"
This reverts commit 8899b34e1044b08aec7ad9f8546652456472702c.
Diffstat (limited to 'src/mongo/db/storage/devnull')
-rw-r--r-- | src/mongo/db/storage/devnull/devnull_kv_engine.cpp | 10 | ||||
-rw-r--r-- | src/mongo/db/storage/devnull/devnull_kv_engine.h | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/mongo/db/storage/devnull/devnull_kv_engine.cpp b/src/mongo/db/storage/devnull/devnull_kv_engine.cpp index 28048f6edc4..8255616eba7 100644 --- a/src/mongo/db/storage/devnull/devnull_kv_engine.cpp +++ b/src/mongo/db/storage/devnull/devnull_kv_engine.cpp @@ -261,13 +261,13 @@ std::unique_ptr<SortedDataInterface> DevNullKVEngine::getSortedDataInterface( return std::make_unique<DevNullSortedDataInterface>(); } -int64_t DevNullKVEngine::getCacheOverflowTableInsertCount(OperationContext* opCtx) const { - return _overflowTableInsertCountForTest; +bool DevNullKVEngine::isCacheUnderPressure(OperationContext* opCtx) const { + return (_cachePressureForTest >= snapshotWindowParams.cachePressureThreshold.load()); } -void DevNullKVEngine::setCacheOverflowTableInsertCountForTest(int insertsCount) { - invariant(insertsCount >= 0); - _overflowTableInsertCountForTest = insertsCount; +void DevNullKVEngine::setCachePressureForTest(int pressure) { + invariant(pressure >= 0 && pressure <= 100); + _cachePressureForTest = pressure; } StatusWith<std::vector<std::string>> DevNullKVEngine::beginNonBlockingBackup( diff --git a/src/mongo/db/storage/devnull/devnull_kv_engine.h b/src/mongo/db/storage/devnull/devnull_kv_engine.h index 7fcf3968f5c..5f52ed44b7d 100644 --- a/src/mongo/db/storage/devnull/devnull_kv_engine.h +++ b/src/mongo/db/storage/devnull/devnull_kv_engine.h @@ -97,9 +97,9 @@ public: return true; } - virtual int64_t getCacheOverflowTableInsertCount(OperationContext* opCtx) const override; + virtual bool isCacheUnderPressure(OperationContext* opCtx) const override; - virtual void setCacheOverflowTableInsertCountForTest(int insertCount) override; + virtual void setCachePressureForTest(int pressure) override; virtual int64_t getIdentSize(OperationContext* opCtx, StringData ident) { return 1; @@ -154,6 +154,6 @@ public: private: std::shared_ptr<void> _catalogInfo; - int _overflowTableInsertCountForTest; + int _cachePressureForTest; }; } |