summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2019-01-23 15:40:21 -0500
committerGregory Wlodarek <gregory.wlodarek@mongodb.com>2019-01-23 15:40:21 -0500
commit87ca277a86cba6fb7e129e341e8785eada8a1589 (patch)
treebce9c3253046055a096f264388ece85062cdb154 /src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
parent6ece5d5c8da8403781c641e35c7e8e1d96f6e10f (diff)
downloadmongo-87ca277a86cba6fb7e129e341e8785eada8a1589.tar.gz
Revert "SERVER-38527 Merge supportsRecoverToStableTimestamp into supportsRecoveryTimestamp"
This reverts commit b54951b484b2cba44ffa424f43acb870365e3f12.
Diffstat (limited to 'src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp')
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
index 833f34d98e5..3353b835cd9 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
@@ -1729,6 +1729,13 @@ void WiredTigerKVEngine::setInitialDataTimestamp(Timestamp initialDataTimestamp)
_initialDataTimestamp.store(initialDataTimestamp.asULL());
}
+bool WiredTigerKVEngine::supportsRecoverToStableTimestamp() const {
+ if (!_keepDataHistory) {
+ return false;
+ }
+ return true;
+}
+
bool WiredTigerKVEngine::supportsRecoveryTimestamp() const {
return true;
}
@@ -1743,6 +1750,11 @@ bool WiredTigerKVEngine::_canRecoverToStableTimestamp() const {
}
StatusWith<Timestamp> WiredTigerKVEngine::recoverToStableTimestamp(OperationContext* opCtx) {
+ if (!supportsRecoverToStableTimestamp()) {
+ severe() << "WiredTiger is configured to not support recover to a stable timestamp";
+ fassertFailed(50665);
+ }
+
if (!_canRecoverToStableTimestamp()) {
Timestamp stableTS(_stableTimestamp.load());
Timestamp initialDataTS(_initialDataTimestamp.load());
@@ -1812,12 +1824,24 @@ Timestamp WiredTigerKVEngine::getOldestOpenReadTimestamp() const {
}
boost::optional<Timestamp> WiredTigerKVEngine::getRecoveryTimestamp() const {
- if (_recoveryTimestamp.isNull())
+ if (!supportsRecoveryTimestamp()) {
+ severe() << "WiredTiger is configured to not support providing a recovery timestamp";
+ fassertFailed(50745);
+ }
+
+ if (_recoveryTimestamp.isNull()) {
return boost::none;
+ }
+
return _recoveryTimestamp;
}
boost::optional<Timestamp> WiredTigerKVEngine::getLastStableRecoveryTimestamp() const {
+ if (!supportsRecoverToStableTimestamp()) {
+ severe() << "WiredTiger is configured to not support recover to a stable timestamp";
+ fassertFailed(50770);
+ }
+
if (_ephemeral) {
Timestamp stable(_stableTimestamp.load());
Timestamp initialData(_initialDataTimestamp.load());