summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2021-11-03 09:51:38 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-11-03 15:09:59 +0000
commite28293624165173a0886b7713e5b0c39ef662966 (patch)
tree47e19861fbc993c4e653a6807543d96a5cfabe64 /src
parent6385224862d53c94235a006547a4eb9e77f990a8 (diff)
downloadmongo-e28293624165173a0886b7713e5b0c39ef662966.tar.gz
SERVER-61177 add KVEngine::dump() and StorageEngine::dump()
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/storage/devnull/devnull_kv_engine.h2
-rw-r--r--src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_kv_engine.h2
-rw-r--r--src/mongo/db/storage/kv/kv_drop_pending_ident_reaper_test.cpp2
-rw-r--r--src/mongo/db/storage/kv/kv_engine.h5
-rw-r--r--src/mongo/db/storage/storage_engine.h5
-rw-r--r--src/mongo/db/storage/storage_engine_impl.cpp4
-rw-r--r--src/mongo/db/storage/storage_engine_impl.h2
-rw-r--r--src/mongo/db/storage/storage_engine_mock.h2
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp2
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h2
10 files changed, 28 insertions, 0 deletions
diff --git a/src/mongo/db/storage/devnull/devnull_kv_engine.h b/src/mongo/db/storage/devnull/devnull_kv_engine.h
index 7327d8541fc..86fac5527af 100644
--- a/src/mongo/db/storage/devnull/devnull_kv_engine.h
+++ b/src/mongo/db/storage/devnull/devnull_kv_engine.h
@@ -161,6 +161,8 @@ public:
virtual void setPinnedOplogTimestamp(const Timestamp& pinnedTimestamp) {}
+ void dump() const override {}
+
// This sets the results of the backup cursor for unit tests.
void setBackupBlocks_forTest(std::vector<StorageEngine::BackupBlock> newBackupBlocks) {
_mockBackupBlocks = newBackupBlocks;
diff --git a/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_kv_engine.h b/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_kv_engine.h
index 5d8db6a1c56..517bcf16df9 100644
--- a/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_kv_engine.h
+++ b/src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_kv_engine.h
@@ -206,6 +206,8 @@ public:
void setPinnedOplogTimestamp(const Timestamp& pinnedTimestamp) {}
+ void dump() const override {}
+
private:
void _cleanHistory(WithLock);
diff --git a/src/mongo/db/storage/kv/kv_drop_pending_ident_reaper_test.cpp b/src/mongo/db/storage/kv/kv_drop_pending_ident_reaper_test.cpp
index ab5a81442e1..df4470cd80d 100644
--- a/src/mongo/db/storage/kv/kv_drop_pending_ident_reaper_test.cpp
+++ b/src/mongo/db/storage/kv/kv_drop_pending_ident_reaper_test.cpp
@@ -130,6 +130,8 @@ public:
void setPinnedOplogTimestamp(const Timestamp& pinnedTimestamp) {}
+ void dump() const override {}
+
// List of ident names removed using dropIdent().
std::vector<std::string> droppedIdents;
diff --git a/src/mongo/db/storage/kv/kv_engine.h b/src/mongo/db/storage/kv/kv_engine.h
index 5a302b47c0f..2503db506b8 100644
--- a/src/mongo/db/storage/kv/kv_engine.h
+++ b/src/mongo/db/storage/kv/kv_engine.h
@@ -402,6 +402,11 @@ public:
virtual void setPinnedOplogTimestamp(const Timestamp& pinnedTimestamp) = 0;
/**
+ * See `StorageEngine::dump`
+ */
+ virtual void dump() const = 0;
+
+ /**
* The destructor will never be called from mongod, but may be called from tests.
* Engines may assume that this will only be called in the case of clean shutdown, even if
* cleanShutdown() hasn't been called.
diff --git a/src/mongo/db/storage/storage_engine.h b/src/mongo/db/storage/storage_engine.h
index c5dd5d78e50..f7c706b96a6 100644
--- a/src/mongo/db/storage/storage_engine.h
+++ b/src/mongo/db/storage/storage_engine.h
@@ -678,6 +678,11 @@ public:
* it.
*/
virtual void setPinnedOplogTimestamp(const Timestamp& pinnedTimestamp) = 0;
+
+ /**
+ * Instructs the storage engine to dump its internal state.
+ */
+ virtual void dump() const = 0;
};
} // namespace mongo
diff --git a/src/mongo/db/storage/storage_engine_impl.cpp b/src/mongo/db/storage/storage_engine_impl.cpp
index d98db8bda77..b4f7ba4c807 100644
--- a/src/mongo/db/storage/storage_engine_impl.cpp
+++ b/src/mongo/db/storage/storage_engine_impl.cpp
@@ -1295,4 +1295,8 @@ const DurableCatalog* StorageEngineImpl::getCatalog() const {
return _catalog.get();
}
+void StorageEngineImpl::dump() const {
+ _engine->dump();
+}
+
} // namespace mongo
diff --git a/src/mongo/db/storage/storage_engine_impl.h b/src/mongo/db/storage/storage_engine_impl.h
index f0c4d1229bf..f2b69e8d2ee 100644
--- a/src/mongo/db/storage/storage_engine_impl.h
+++ b/src/mongo/db/storage/storage_engine_impl.h
@@ -357,6 +357,8 @@ public:
void setPinnedOplogTimestamp(const Timestamp& pinnedTimestamp) override;
+ void dump() const override;
+
private:
using CollIter = std::list<std::string>::iterator;
diff --git a/src/mongo/db/storage/storage_engine_mock.h b/src/mongo/db/storage/storage_engine_mock.h
index 881cd26979f..7032a3afe87 100644
--- a/src/mongo/db/storage/storage_engine_mock.h
+++ b/src/mongo/db/storage/storage_engine_mock.h
@@ -202,6 +202,8 @@ public:
void unpinOldestTimestamp(const std::string& requestingServiceName) final {}
void setPinnedOplogTimestamp(const Timestamp& pinnedTimestamp) final {}
+
+ void dump() const final {}
};
} // namespace mongo
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
index 85bc7b91ba2..8dc7a38533c 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
@@ -2524,4 +2524,6 @@ std::uint64_t WiredTigerKVEngine::_getCheckpointTimestamp() const {
return tmp;
}
+void WiredTigerKVEngine::dump() const {}
+
} // namespace mongo
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h
index 8d951088935..1301a0c07b8 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h
@@ -361,6 +361,8 @@ public:
void setPinnedOplogTimestamp(const Timestamp& pinnedTimestamp) override;
+ void dump() const override;
+
private:
class WiredTigerSessionSweeper;