diff options
author | Matthew Russotto <matthew.russotto@10gen.com> | 2018-11-06 13:18:38 -0500 |
---|---|---|
committer | Matthew Russotto <matthew.russotto@10gen.com> | 2018-11-06 15:24:52 -0500 |
commit | cbd0a1a3df662c54da23d5def4ccc10dd1c1f88e (patch) | |
tree | 6f34d61445dae91a2264f2bb455408feb1427b42 /src/mongo/db/repl/initial_syncer.cpp | |
parent | eae0b57705a7b18362b7028c6fcb7c2469043ef4 (diff) | |
download | mongo-cbd0a1a3df662c54da23d5def4ccc10dd1c1f88e.tar.gz |
SERVER-37408 Add afterClusterTime to initial sync collection scans
Diffstat (limited to 'src/mongo/db/repl/initial_syncer.cpp')
-rw-r--r-- | src/mongo/db/repl/initial_syncer.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/repl/initial_syncer.cpp b/src/mongo/db/repl/initial_syncer.cpp index dcdcff54d5a..6b68c13a7ea 100644 --- a/src/mongo/db/repl/initial_syncer.cpp +++ b/src/mongo/db/repl/initial_syncer.cpp @@ -685,6 +685,13 @@ void InitialSyncer::_lastOplogEntryFetcherCallbackForBeginTimestamp( auto filterBob = BSONObjBuilder(queryBob.subobjStart("filter")); filterBob.append("_id", FeatureCompatibilityVersionParser::kParameterName); filterBob.done(); + // As part of reading the FCV, we ensure the source node "all committed" timestamp has advanced + // to at least the timestamp of the last optime that we found in the lastOplogEntryFetcher. + // When document locking is used, there could be oplog "holes" which would result in + // inconsistent initial sync data if we didn't do this. + auto readConcernBob = BSONObjBuilder(queryBob.subobjStart("readConcern")); + readConcernBob.append("afterClusterTime", lastOpTimeWithHash.opTime.getTimestamp()); + readConcernBob.done(); _fCVFetcher = stdx::make_unique<Fetcher>( _exec, |