summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKyle Suarez <ksuarz@gmail.com>2016-02-29 17:28:51 -0500
committerEric Milkie <milkie@10gen.com>2016-04-19 09:59:44 -0400
commit07981debd3335d53909e169baad92240916baf53 (patch)
tree019940e6ca5c7669692c0590bbf3dcdab92e9ca2 /src
parentae221cb5e40350c5d184f49400eacfa3e3526ee6 (diff)
downloadmongo-07981debd3335d53909e169baad92240916baf53.tar.gz
SERVER-21414 serverStatus storageEngine.persistent
Under the server status statistics, "storageEngine.persistent" is either 0 or 1 to indicate if the storage engine persists data to disk. (cherry picked from commit 76cc3b37b1912c35c80084b859efcdc93b104637)
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp4
-rw-r--r--src/mongo/db/storage/mmap_v1/mmap_v1_engine.h2
-rw-r--r--src/mongo/db/storage/storage_engine.h5
-rw-r--r--src/mongo/db/storage/storage_init.cpp3
4 files changed, 13 insertions, 1 deletions
diff --git a/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp b/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp
index 160c268c6fa..71913e7b389 100644
--- a/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp
+++ b/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp
@@ -337,6 +337,10 @@ bool MMAPV1Engine::isDurable() const {
return getDur().isDurable();
}
+bool MMAPV1Engine::isEphemeral() const {
+ return false;
+}
+
RecordAccessTracker& MMAPV1Engine::getRecordAccessTracker() {
return _recordAccessTracker;
}
diff --git a/src/mongo/db/storage/mmap_v1/mmap_v1_engine.h b/src/mongo/db/storage/mmap_v1/mmap_v1_engine.h
index 4fac787b4b0..7488a6592ff 100644
--- a/src/mongo/db/storage/mmap_v1/mmap_v1_engine.h
+++ b/src/mongo/db/storage/mmap_v1/mmap_v1_engine.h
@@ -66,6 +66,8 @@ public:
virtual bool isDurable() const;
+ virtual bool isEphemeral() const;
+
virtual Status closeDatabase(OperationContext* txn, StringData db);
virtual Status dropDatabase(OperationContext* txn, StringData db);
diff --git a/src/mongo/db/storage/storage_engine.h b/src/mongo/db/storage/storage_engine.h
index 73330798d1c..7fcee4cfa10 100644
--- a/src/mongo/db/storage/storage_engine.h
+++ b/src/mongo/db/storage/storage_engine.h
@@ -171,6 +171,11 @@ public:
virtual bool isDurable() const = 0;
/**
+ * Returns true if the engine does not persist data to disk; false otherwise.
+ */
+ virtual bool isEphemeral() const = 0;
+
+ /**
* Only MMAPv1 should override this and return true to trigger MMAPv1-specific behavior.
*/
virtual bool isMmapV1() const {
diff --git a/src/mongo/db/storage/storage_init.cpp b/src/mongo/db/storage/storage_init.cpp
index a90ddecfe25..365369e6855 100644
--- a/src/mongo/db/storage/storage_init.cpp
+++ b/src/mongo/db/storage/storage_init.cpp
@@ -55,7 +55,8 @@ public:
virtual BSONObj generateSection(OperationContext* txn, const BSONElement& configElement) const {
auto engine = txn->getClient()->getServiceContext()->getGlobalStorageEngine();
return BSON("name" << storageGlobalParams.engine << "supportsCommittedReads"
- << bool(engine->getSnapshotManager()));
+ << bool(engine->getSnapshotManager()) << "persistent"
+ << !engine->isEphemeral());
}
} storageSSS;