summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/sync_tail.cpp
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2016-09-09 17:48:35 -0400
committerMathias Stearn <mathias@10gen.com>2016-09-16 16:52:29 -0400
commitdc83fb0433fcae6e72f035df7458473b59223eb5 (patch)
tree9ec4d2f312f565cea234e3323dad17872e451522 /src/mongo/db/repl/sync_tail.cpp
parent446c059c3086dcb579816d29b8e1b43da13e8dbb (diff)
downloadmongo-dc83fb0433fcae6e72f035df7458473b59223eb5.tar.gz
SERVER-26016 Add a basic test of oplog replay on startup
Fixes a small but important bug in SERVER-7200.
Diffstat (limited to 'src/mongo/db/repl/sync_tail.cpp')
-rw-r--r--src/mongo/db/repl/sync_tail.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mongo/db/repl/sync_tail.cpp b/src/mongo/db/repl/sync_tail.cpp
index 91d6592ad58..992ed5b3781 100644
--- a/src/mongo/db/repl/sync_tail.cpp
+++ b/src/mongo/db/repl/sync_tail.cpp
@@ -804,10 +804,11 @@ void SyncTail::oplogApplication(ReplicationCoordinator* replCoord) {
// Do the work.
multiApply(&txn, ops.releaseBatch());
- // Update various things that care about our last applied optime.
- setNewTimestamp(lastOpTimeInBatch.getTimestamp());
- StorageInterface::get(&txn)->setAppliedThrough(&txn, lastOpTimeInBatch);
- finalizer->record(lastOpTimeInBatch);
+ // Update various things that care about our last applied optime. Tests rely on 2 happening
+ // before 3 even though it isn't strictly necessary. The order of 1 doesn't matter.
+ setNewTimestamp(lastOpTimeInBatch.getTimestamp()); // 1
+ StorageInterface::get(&txn)->setAppliedThrough(&txn, lastOpTimeInBatch); // 2
+ finalizer->record(lastOpTimeInBatch); // 3
}
}