summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/sync_tail_test_fixture.cpp
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2018-05-30 17:45:19 -0400
committerBenety Goh <benety@mongodb.com>2018-05-30 17:45:19 -0400
commitd2978d6af210356616c07193a29641a41f797d8b (patch)
tree728bef158f825e4b0b5bae838ee3fc888ca34c6f /src/mongo/db/repl/sync_tail_test_fixture.cpp
parentb65f5147a512cd57a323eb5853a503d8cf1bb557 (diff)
downloadmongo-d2978d6af210356616c07193a29641a41f797d8b.tar.gz
SERVER-32335 implement multiInitialSyncApply in terms of multiSyncApply
Extends multiSyncApply to fetch missing documents on failed updates
Diffstat (limited to 'src/mongo/db/repl/sync_tail_test_fixture.cpp')
-rw-r--r--src/mongo/db/repl/sync_tail_test_fixture.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mongo/db/repl/sync_tail_test_fixture.cpp b/src/mongo/db/repl/sync_tail_test_fixture.cpp
index 8b8553bd886..3f6029b15a6 100644
--- a/src/mongo/db/repl/sync_tail_test_fixture.cpp
+++ b/src/mongo/db/repl/sync_tail_test_fixture.cpp
@@ -85,6 +85,14 @@ void SyncTailOpObserver::onCreateCollection(OperationContext* opCtx,
onCreateCollectionFn(opCtx, coll, collectionName, options, idIndex);
}
+// static
+OplogApplier::Options SyncTailTest::makeInitialSyncOptions() {
+ OplogApplier::Options options;
+ options.allowNamespaceNotFoundErrorsOnCrudOps = true;
+ options.missingDocumentSourceForInitialSync = HostAndPort("localhost", 123);
+ return options;
+}
+
void SyncTailTest::setUp() {
ServiceContextMongoDTest::setUp();
@@ -208,11 +216,13 @@ Status SyncTailTest::runOpInitialSync(const OplogEntry& op) {
}
Status SyncTailTest::runOpsInitialSync(std::vector<OplogEntry> ops) {
+ auto options = makeInitialSyncOptions();
SyncTail syncTail(nullptr,
getConsistencyMarkers(),
getStorageInterface(),
SyncTail::MultiSyncApplyFunc(),
- nullptr);
+ nullptr,
+ options);
// Apply each operation in a batch of one because 'ops' may contain a mix of commands and CRUD
// operations provided by idempotency tests.
for (auto& op : ops) {