summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/wiredtiger
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2019-07-26 12:25:26 -0400
committerGregory Wlodarek <gregory.wlodarek@mongodb.com>2019-07-26 12:34:32 -0400
commit25d5f6a0b01f261e633587013e4ab8116ea2930a (patch)
treeb9659a708b228b7027a859ef8ed7b89b7b4f73b9 /src/mongo/db/storage/wiredtiger
parent5f7471631d238fb3269fa0f2c3689ac62e93b61f (diff)
downloadmongo-25d5f6a0b01f261e633587013e4ab8116ea2930a.tar.gz
SERVER-41861 Replace 'all_committed' with 'all_durable'
Diffstat (limited to 'src/mongo/db/storage/wiredtiger')
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp4
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h2
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.cpp10
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.h8
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp30
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.h4
6 files changed, 29 insertions, 29 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
index 422f838ba5f..026e7d59c74 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
@@ -1761,8 +1761,8 @@ StatusWith<Timestamp> WiredTigerKVEngine::recoverToStableTimestamp(OperationCont
return {stableTimestamp};
}
-Timestamp WiredTigerKVEngine::getAllCommittedTimestamp() const {
- return Timestamp(_oplogManager->fetchAllCommittedValue(_conn));
+Timestamp WiredTigerKVEngine::getAllDurableTimestamp() const {
+ return Timestamp(_oplogManager->fetchAllDurableValue(_conn));
}
Timestamp WiredTigerKVEngine::getOldestOpenReadTimestamp() const {
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h
index 625cb5a565a..c1502094ec5 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.h
@@ -230,7 +230,7 @@ public:
*/
boost::optional<Timestamp> getLastStableRecoveryTimestamp() const override;
- Timestamp getAllCommittedTimestamp() const override;
+ Timestamp getAllDurableTimestamp() const override;
Timestamp getOldestOpenReadTimestamp() const override;
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.cpp
index 28dd48f261f..e3ec7e9097d 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.cpp
@@ -207,7 +207,7 @@ void WiredTigerOplogManager::_oplogJournalThreadLoop(WiredTigerSessionCache* ses
_opsWaitingForJournal = false;
lk.unlock();
- const uint64_t newTimestamp = fetchAllCommittedValue(sessionCache->conn());
+ const uint64_t newTimestamp = fetchAllDurableValue(sessionCache->conn());
// The newTimestamp may actually go backward during secondary batch application,
// where we commit data file changes separately from oplog changes, so ignore
@@ -249,11 +249,11 @@ void WiredTigerOplogManager::_setOplogReadTimestamp(WithLock, uint64_t newTimest
LOG(2) << "Setting new oplogReadTimestamp: " << Timestamp(newTimestamp);
}
-uint64_t WiredTigerOplogManager::fetchAllCommittedValue(WT_CONNECTION* conn) {
- // Fetch the latest all_committed value from the storage engine. This value will be a
- // timestamp that has no holes (uncommitted transactions with lower timestamps) behind it.
+uint64_t WiredTigerOplogManager::fetchAllDurableValue(WT_CONNECTION* conn) {
+ // Fetch the latest all_durable value from the storage engine. This value will be a timestamp
+ // that has no holes (uncommitted transactions with lower timestamps) behind it.
char buf[(2 * 8 /*bytes in hex*/) + 1 /*nul terminator*/];
- auto wtstatus = conn->query_timestamp(conn, buf, "get=all_committed");
+ auto wtstatus = conn->query_timestamp(conn, buf, "get=all_durable");
if (wtstatus == WT_NOTFOUND) {
// Treat this as lowest possible timestamp; we need to see all preexisting data but no new
// (timestamped) data.
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.h b/src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.h
index f71ba7e5214..9a82985fc28 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.h
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_oplog_manager.h
@@ -41,7 +41,7 @@ class WiredTigerRecordStore;
class WiredTigerSessionCache;
-// Manages oplog visibility, by periodically querying WiredTiger's all_committed timestamp value and
+// Manages oplog visibility, by periodically querying WiredTiger's all_durable timestamp value and
// then using that timestamp for all transactions that read the oplog collection.
class WiredTigerOplogManager {
WiredTigerOplogManager(const WiredTigerOplogManager&) = delete;
@@ -78,9 +78,9 @@ public:
void waitForAllEarlierOplogWritesToBeVisible(const WiredTigerRecordStore* oplogRecordStore,
OperationContext* opCtx);
- // Returns the all committed timestamp. All transactions with timestamps earlier than the
- // all committed timestamp are committed.
- uint64_t fetchAllCommittedValue(WT_CONNECTION* conn);
+ // Returns the all_durable timestamp. All transactions with timestamps earlier than the
+ // all_durable timestamp are committed.
+ uint64_t fetchAllDurableValue(WT_CONNECTION* conn);
private:
void _oplogJournalThreadLoop(WiredTigerSessionCache* sessionCache,
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp
index 3f26c7b8614..33f1548411c 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.cpp
@@ -425,7 +425,7 @@ boost::optional<Timestamp> WiredTigerRecoveryUnit::getPointInTimeReadTimestamp()
// opened.
case ReadSource::kNoOverlap:
case ReadSource::kLastApplied:
- case ReadSource::kAllCommittedSnapshot:
+ case ReadSource::kAllDurableSnapshot:
break;
}
@@ -441,7 +441,7 @@ boost::optional<Timestamp> WiredTigerRecoveryUnit::getPointInTimeReadTimestamp()
}
return boost::none;
case ReadSource::kNoOverlap:
- case ReadSource::kAllCommittedSnapshot:
+ case ReadSource::kAllDurableSnapshot:
invariant(!_readAtTimestamp.isNull());
return _readAtTimestamp;
@@ -501,9 +501,9 @@ void WiredTigerRecoveryUnit::_txnOpen() {
_readAtTimestamp = _beginTransactionAtNoOverlapTimestamp(session);
break;
}
- case ReadSource::kAllCommittedSnapshot: {
+ case ReadSource::kAllDurableSnapshot: {
if (_readAtTimestamp.isNull()) {
- _readAtTimestamp = _beginTransactionAtAllCommittedTimestamp(session);
+ _readAtTimestamp = _beginTransactionAtAllDurableTimestamp(session);
break;
}
// Intentionally continue to the next case to read at the _readAtTimestamp.
@@ -527,17 +527,17 @@ void WiredTigerRecoveryUnit::_txnOpen() {
LOG(3) << "WT begin_transaction for snapshot id " << _mySnapshotId;
}
-Timestamp WiredTigerRecoveryUnit::_beginTransactionAtAllCommittedTimestamp(WT_SESSION* session) {
+Timestamp WiredTigerRecoveryUnit::_beginTransactionAtAllDurableTimestamp(WT_SESSION* session) {
WiredTigerBeginTxnBlock txnOpen(session,
_prepareConflictBehavior,
_roundUpPreparedTimestamps,
RoundUpReadTimestamp::kRound);
- Timestamp txnTimestamp = Timestamp(_oplogManager->fetchAllCommittedValue(session->connection));
+ Timestamp txnTimestamp = Timestamp(_oplogManager->fetchAllDurableValue(session->connection));
auto status = txnOpen.setReadSnapshot(txnTimestamp);
fassert(50948, status);
// Since this is not in a critical section, we might have rounded to oldest between
- // calling getAllCommitted and setReadSnapshot. We need to get the actual read timestamp we
+ // calling getAllDurable and setReadSnapshot. We need to get the actual read timestamp we
// used.
auto readTimestamp = _getTransactionReadTimestamp(session);
txnOpen.done();
@@ -547,7 +547,7 @@ Timestamp WiredTigerRecoveryUnit::_beginTransactionAtAllCommittedTimestamp(WT_SE
Timestamp WiredTigerRecoveryUnit::_beginTransactionAtNoOverlapTimestamp(WT_SESSION* session) {
auto lastApplied = _sessionCache->snapshotManager().getLocalSnapshot();
- Timestamp allCommitted = Timestamp(_oplogManager->fetchAllCommittedValue(session->connection));
+ Timestamp allDurable = Timestamp(_oplogManager->fetchAllDurableValue(session->connection));
// When using timestamps for reads and writes, it's important that readers and writers don't
// overlap with the timestamps they use. In other words, at any point in the system there should
@@ -555,13 +555,13 @@ Timestamp WiredTigerRecoveryUnit::_beginTransactionAtNoOverlapTimestamp(WT_SESSI
// at, or earlier than T. This time T is called the no-overlap point. Using the `kNoOverlap`
// ReadSource will compute the most recent known time that is safe to read at.
- // The no-overlap point is computed as the minimum of the storage engine's all-committed time
+ // The no-overlap point is computed as the minimum of the storage engine's all_durable time
// and replication's last applied time. On primaries, the last applied time is updated as
// transactions commit, which is not necessarily in the order they appear in the oplog. Thus
- // the all-committed time is an appropriate value to read at.
+ // the all_durable time is an appropriate value to read at.
- // On secondaries, however, the all-committed time, as computed by the storage engine, can
- // advance before oplog application completes a batch. This is because the all-committed time
+ // On secondaries, however, the all_durable time, as computed by the storage engine, can
+ // advance before oplog application completes a batch. This is because the all_durable time
// is only computed correctly if the storage engine is informed of commit timestamps in
// increasing order. Because oplog application processes a batch of oplog entries out of order,
// the timestamping requirement is not satisfied. Secondaries, however, only update the last
@@ -569,11 +569,11 @@ Timestamp WiredTigerRecoveryUnit::_beginTransactionAtNoOverlapTimestamp(WT_SESSI
// secondaries.
// By taking the minimum of the two values, storage can compute a legal time to read at without
- // knowledge of the replication state. The no-overlap point is the minimum of the all-committed
+ // knowledge of the replication state. The no-overlap point is the minimum of the all_durable
// time, which represents the point where no transactions will commit any earlier, and
// lastApplied, which represents the highest optime a node has applied, a point no readers
// should read afterward.
- Timestamp readTimestamp = (lastApplied) ? std::min(*lastApplied, allCommitted) : allCommitted;
+ Timestamp readTimestamp = (lastApplied) ? std::min(*lastApplied, allDurable) : allDurable;
WiredTigerBeginTxnBlock txnOpen(session,
_prepareConflictBehavior,
@@ -582,7 +582,7 @@ Timestamp WiredTigerRecoveryUnit::_beginTransactionAtNoOverlapTimestamp(WT_SESSI
auto status = txnOpen.setReadSnapshot(readTimestamp);
fassert(51066, status);
- // We might have rounded to oldest between calling getAllCommitted and setReadSnapshot. We need
+ // We might have rounded to oldest between calling getAllDurable and setReadSnapshot. We need
// to get the actual read timestamp we used.
readTimestamp = _getTransactionReadTimestamp(session);
txnOpen.done();
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.h b/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.h
index 7ed61acf29b..81483c51cd7 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.h
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_recovery_unit.h
@@ -208,10 +208,10 @@ private:
void _txnOpen();
/**
- * Starts a transaction at the current all-committed timestamp.
+ * Starts a transaction at the current all_durable timestamp.
* Returns the timestamp the transaction was started at.
*/
- Timestamp _beginTransactionAtAllCommittedTimestamp(WT_SESSION* session);
+ Timestamp _beginTransactionAtAllDurableTimestamp(WT_SESSION* session);
/**
* Starts a transaction at the no-overlap timestamp. Returns the timestamp the transaction