diff options
author | Siyuan Zhou <siyuan.zhou@mongodb.com> | 2015-05-04 20:01:26 -0400 |
---|---|---|
committer | Siyuan Zhou <siyuan.zhou@mongodb.com> | 2015-05-12 15:36:54 -0400 |
commit | 3341d6407fb8ba147303432027db0ed006a85c46 (patch) | |
tree | b493ad301c7c6d25e6fcf523a45d130234455ae3 /src/mongo/db/repl/rs_initialsync.cpp | |
parent | b3b37ae5c708ae1876f189e6c685ab06026e86ee (diff) | |
download | mongo-3341d6407fb8ba147303432027db0ed006a85c46.tar.gz |
SERVER-18217 Change Timestamp to OpTime where appropriate.
Diffstat (limited to 'src/mongo/db/repl/rs_initialsync.cpp')
-rw-r--r-- | src/mongo/db/repl/rs_initialsync.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mongo/db/repl/rs_initialsync.cpp b/src/mongo/db/repl/rs_initialsync.cpp index 22817bc7746..174999bf601 100644 --- a/src/mongo/db/repl/rs_initialsync.cpp +++ b/src/mongo/db/repl/rs_initialsync.cpp @@ -220,7 +220,9 @@ namespace { bool _initialSyncApplyOplog( OperationContext* ctx, repl::SyncTail& syncer, OplogReader* r) { - const Timestamp startOpTime = getGlobalReplicationCoordinator()->getMyLastOptime(); + // TODO(siyuan) Change to OpTime after adding term to op logs. + const Timestamp startOpTime = getGlobalReplicationCoordinator()->getMyLastOptime() + .getTimestamp(); BSONObj lastOp; // If the fail point is set, exit failing. @@ -412,10 +414,10 @@ namespace { std::deque<BSONObj> ops; ops.push_back(lastOp); - Timestamp lastOptime = writeOpsToOplog(&txn, ops); + OpTime lastOptime = writeOpsToOplog(&txn, ops); ReplClientInfo::forClient(txn.getClient()).setLastOp(lastOptime); replCoord->setMyLastOptime(lastOptime); - setNewOptime(lastOptime); + setNewOptime(lastOptime.getTimestamp()); std::string msg = "oplog sync 1 of 3"; log() << msg; @@ -464,7 +466,9 @@ namespace { { ScopedTransaction scopedXact(&txn, MODE_IX); AutoGetDb autodb(&txn, "local", MODE_X); - Timestamp lastOpTimeWritten(getGlobalReplicationCoordinator()->getMyLastOptime()); + // TODO(siyuan) Change to OpTime after adding term to op logs. + Timestamp lastOpTimeWritten( + getGlobalReplicationCoordinator()->getMyLastOptime().getTimestamp()); log() << "set minValid=" << lastOpTimeWritten; // Initial sync is now complete. Flag this by setting minValid to the last thing |