diff options
author | Daniel Gottlieb <daniel.gottlieb@mongodb.com> | 2017-12-11 09:32:04 -0500 |
---|---|---|
committer | Daniel Gottlieb <daniel.gottlieb@mongodb.com> | 2017-12-11 09:32:28 -0500 |
commit | 1a80d3e2817f758f07fa4de722ad278df4de7ac7 (patch) | |
tree | e94c4391e339200de9b26718be6cf3712ae9254a /src/mongo/db/repl/replication_coordinator_impl.cpp | |
parent | a89e8f0d97b860beb93d71569f2b155fee87f120 (diff) | |
download | mongo-1a80d3e2817f758f07fa4de722ad278df4de7ac7.tar.gz |
SERVER-32226: Have the oldest timestamp track the last applied optime during initial sync.
Diffstat (limited to 'src/mongo/db/repl/replication_coordinator_impl.cpp')
-rw-r--r-- | src/mongo/db/repl/replication_coordinator_impl.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/repl/replication_coordinator_impl.cpp b/src/mongo/db/repl/replication_coordinator_impl.cpp index d34e4bff65e..bc178dc9ecf 100644 --- a/src/mongo/db/repl/replication_coordinator_impl.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl.cpp @@ -1149,6 +1149,11 @@ void ReplicationCoordinatorImpl::_setMyLastAppliedOpTime_inlock(const OpTime& op if (opTime <= _topCoord->getLastCommittedOpTime()) { _setStableTimestampForStorage_inlock(); } + } else if (_getMemberState_inlock().startup2()) { + // The oplog application phase of initial sync starts timestamping writes, causing + // WiredTiger to pin this data in memory. Advancing the oldest timestamp in step with the + // last applied optime here will permit WiredTiger to evict this data as it sees fit. + _service->getGlobalStorageEngine()->setOldestTimestamp(opTime.getTimestamp()); } } |