summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/devnull
diff options
context:
space:
mode:
authorDianna Hohensee <dianna.hohensee@10gen.com>2019-07-01 10:01:15 -0400
committerDianna Hohensee <dianna.hohensee@10gen.com>2019-07-01 14:10:25 -0400
commit8bb53a07a5c593d85b6229a2afe096b3e1efe21d (patch)
tree8cf4cce2f88edd9256a08d2a6b9b6bfb1aea8cad /src/mongo/db/storage/devnull
parent8cb025148fb78311f97454894324419d1442ce08 (diff)
downloadmongo-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.cpp10
-rw-r--r--src/mongo/db/storage/devnull/devnull_kv_engine.h6
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;
};
}