diff options
author | Lingzhi Deng <lingzhi.deng@mongodb.com> | 2019-12-26 10:56:06 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-01-15 16:18:43 +0000 |
commit | 756a87f2e86d8f67259b5995d8f1cf7dcc27f7a6 (patch) | |
tree | 952bfbcb8959da6d6ca02a44cf74da5d086d2064 /src/mongo/db/s | |
parent | 1156b8a0008afc68d86e41400baf0f7f4e683210 (diff) | |
download | mongo-756a87f2e86d8f67259b5995d8f1cf7dcc27f7a6.tar.gz |
SERVER-39364: Get the last oplog entry from the storage engine for setLastOpToSystemLastOpTime
Diffstat (limited to 'src/mongo/db/s')
-rw-r--r-- | src/mongo/db/s/collection_range_deleter.cpp | 8 | ||||
-rw-r--r-- | src/mongo/db/s/txn_two_phase_commit_cmds.cpp | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/mongo/db/s/collection_range_deleter.cpp b/src/mongo/db/s/collection_range_deleter.cpp index 15a37946f98..ef93a23c06f 100644 --- a/src/mongo/db/s/collection_range_deleter.cpp +++ b/src/mongo/db/s/collection_range_deleter.cpp @@ -340,12 +340,14 @@ boost::optional<Date_t> CollectionRangeDeleter::cleanUpNextRange( LOG(0) << "Waiting for majority replication of local deletions in " << nss.ns() << " range " << redact(range->toString()); - repl::ReplClientInfo::forClient(opCtx->getClient()).setLastOpToSystemLastOpTime(opCtx); - const auto clientOpTime = repl::ReplClientInfo::forClient(opCtx->getClient()).getLastOp(); - // Wait for replication outside the lock const auto replicationStatus = [&] { try { + repl::ReplClientInfo::forClient(opCtx->getClient()) + .setLastOpToSystemLastOpTime(opCtx); + const auto clientOpTime = + repl::ReplClientInfo::forClient(opCtx->getClient()).getLastOp(); + WriteConcernResult unusedWCResult; return waitForWriteConcern( opCtx, clientOpTime, kMajorityWriteConcern, &unusedWCResult); diff --git a/src/mongo/db/s/txn_two_phase_commit_cmds.cpp b/src/mongo/db/s/txn_two_phase_commit_cmds.cpp index 21293128b58..30e1d90ae9e 100644 --- a/src/mongo/db/s/txn_two_phase_commit_cmds.cpp +++ b/src/mongo/db/s/txn_two_phase_commit_cmds.cpp @@ -244,7 +244,7 @@ public: // (in all cases except the one where this command aborts the local participant), so // ensure waiting for the client's writeConcern of the decision. repl::ReplClientInfo::forClient(opCtx->getClient()) - .setLastOpToSystemLastOpTime(opCtx); + .setLastOpToSystemLastOpTimeIgnoringInterrupt(opCtx); }); if (coordinatorDecisionFuture) { |