diff options
author | Eric Milkie <milkie@10gen.com> | 2017-09-19 11:27:59 -0400 |
---|---|---|
committer | Eric Milkie <milkie@10gen.com> | 2017-09-25 13:17:16 -0400 |
commit | 8c118d741327e6e3fe29955f7f75f6fe853297e5 (patch) | |
tree | b215e7de950e487f67fbd8f98fe27437d90a70d3 /src/mongo/db/repl/initial_syncer_test.cpp | |
parent | 62fe0f89e9fa15c69f912d31b822b3631f691fe7 (diff) | |
download | mongo-8c118d741327e6e3fe29955f7f75f6fe853297e5.tar.gz |
SERVER-31086 adorn secondary inserts and vector inserts with timestamps
Diffstat (limited to 'src/mongo/db/repl/initial_syncer_test.cpp')
-rw-r--r-- | src/mongo/db/repl/initial_syncer_test.cpp | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/src/mongo/db/repl/initial_syncer_test.cpp b/src/mongo/db/repl/initial_syncer_test.cpp index 8d765cefc04..952c3d5e2f4 100644 --- a/src/mongo/db/repl/initial_syncer_test.cpp +++ b/src/mongo/db/repl/initial_syncer_test.cpp @@ -242,8 +242,10 @@ protected: _storageInterfaceWorkDone.truncateCalled = true; return Status::OK(); }; - _storageInterface->insertDocumentFn = [this]( - OperationContext* opCtx, const NamespaceString& nss, const TimestampedBSONObj& doc) { + _storageInterface->insertDocumentFn = [this](OperationContext* opCtx, + const NamespaceString& nss, + const TimestampedBSONObj& doc, + long long term) { LockGuard lock(_storageInterfaceWorkDoneMutex); ++_storageInterfaceWorkDone.documentsInsertedCount; return Status::OK(); @@ -2053,12 +2055,17 @@ TEST_F( NamespaceString insertDocumentNss; TimestampedBSONObj insertDocumentDoc; - _storageInterface->insertDocumentFn = [&insertDocumentDoc, &insertDocumentNss]( - OperationContext*, const NamespaceString& nss, const TimestampedBSONObj& doc) { - insertDocumentNss = nss; - insertDocumentDoc = doc; - return Status(ErrorCodes::OperationFailed, "failed to insert oplog entry"); - }; + long long insertDocumentTerm; + _storageInterface->insertDocumentFn = + [&insertDocumentDoc, &insertDocumentNss, &insertDocumentTerm](OperationContext*, + const NamespaceString& nss, + const TimestampedBSONObj& doc, + long long term) { + insertDocumentNss = nss; + insertDocumentDoc = doc; + insertDocumentTerm = term; + return Status(ErrorCodes::OperationFailed, "failed to insert oplog entry"); + }; _syncSourceSelector->setChooseNewSyncSourceResult_forTest(HostAndPort("localhost", 12345)); ASSERT_OK(initialSyncer->startup(opCtx.get(), maxAttempts)); @@ -2112,10 +2119,17 @@ TEST_F( NamespaceString insertDocumentNss; TimestampedBSONObj insertDocumentDoc; - _storageInterface->insertDocumentFn = [initialSyncer, &insertDocumentDoc, &insertDocumentNss]( - OperationContext*, const NamespaceString& nss, const TimestampedBSONObj& doc) { + long long insertDocumentTerm; + _storageInterface->insertDocumentFn = [initialSyncer, + &insertDocumentDoc, + &insertDocumentNss, + &insertDocumentTerm](OperationContext*, + const NamespaceString& nss, + const TimestampedBSONObj& doc, + long long term) { insertDocumentNss = nss; insertDocumentDoc = doc; + insertDocumentTerm = term; initialSyncer->shutdown().transitional_ignore(); return Status::OK(); }; |