summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl
diff options
context:
space:
mode:
authorSiyuan Zhou <siyuan.zhou@mongodb.com>2019-08-23 22:02:08 +0000
committerSiyuan Zhou <visualzhou@gmail.com>2019-09-04 22:35:18 -0400
commit2a3748453d5d00d7f8de91ea75c985f5ad1ce14b (patch)
treed6f385743bdfa4c189102ca6ece9d2f8825a24a4 /src/mongo/db/repl
parentb198f2b3b2502a92f76ea491254b9b6f10dd38ff (diff)
downloadmongo-2a3748453d5d00d7f8de91ea75c985f5ad1ce14b.tar.gz
SERVER-42219 Remove logging death test of signalDrainComplete.
Reverted a5cbd93aea SERVER-32935 add characterization test for exception handling in oplog application loop (cherry picked from commit 89a6d7bc3a0126cf8bfd177ad65b233181641175)
Diffstat (limited to 'src/mongo/db/repl')
-rw-r--r--src/mongo/db/repl/SConscript1
-rw-r--r--src/mongo/db/repl/sync_tail_test.cpp52
2 files changed, 0 insertions, 53 deletions
diff --git a/src/mongo/db/repl/SConscript b/src/mongo/db/repl/SConscript
index 2b19b2a6ba1..779fb0a3275 100644
--- a/src/mongo/db/repl/SConscript
+++ b/src/mongo/db/repl/SConscript
@@ -767,7 +767,6 @@ env.CppUnitTest(
'$BUILD_DIR/mongo/db/stats/counters',
'$BUILD_DIR/mongo/util/clock_source_mock',
'idempotency_test_fixture',
- 'oplog_buffer_blocking_queue',
'oplog_interface_local',
'sync_tail_test_fixture',
],
diff --git a/src/mongo/db/repl/sync_tail_test.cpp b/src/mongo/db/repl/sync_tail_test.cpp
index 95b3d791c14..e9fb2cb0fb1 100644
--- a/src/mongo/db/repl/sync_tail_test.cpp
+++ b/src/mongo/db/repl/sync_tail_test.cpp
@@ -55,9 +55,7 @@
#include "mongo/db/repl/drop_pending_collection_reaper.h"
#include "mongo/db/repl/idempotency_test_fixture.h"
#include "mongo/db/repl/oplog.h"
-#include "mongo/db/repl/oplog_buffer_blocking_queue.h"
#include "mongo/db/repl/replication_coordinator.h"
-#include "mongo/db/repl/replication_coordinator_mock.h"
#include "mongo/db/repl/replication_process.h"
#include "mongo/db/repl/storage_interface.h"
#include "mongo/db/repl/sync_tail.h"
@@ -1903,56 +1901,6 @@ TEST_F(SyncTailTest, MultiSyncApplyFetchesMissingDocumentIfDocumentIsAvailableFr
ASSERT_EQUALS(ErrorCodes::CollectionIsEmpty, collectionReader.next().getStatus());
}
-namespace {
-
-class ReplicationCoordinatorSignalDrainCompleteThrows : public ReplicationCoordinatorMock {
-public:
- ReplicationCoordinatorSignalDrainCompleteThrows(ServiceContext* service,
- const ReplSettings& settings)
- : ReplicationCoordinatorMock(service, settings) {}
- void signalDrainComplete(OperationContext*, long long) final {
- uasserted(ErrorCodes::OperationFailed, "failed to signal drain complete");
- }
-};
-
-} // namespace
-
-DEATH_TEST_F(SyncTailTest,
- OplogApplicationLogsExceptionFromSignalDrainCompleteBeforeAborting,
- "OperationFailed: failed to signal drain complete") {
- // Leave oplog buffer empty so that SyncTail calls
- // ReplicationCoordinator::signalDrainComplete() during oplog application.
- auto oplogBuffer = std::make_unique<OplogBufferBlockingQueue>();
-
- auto applyOperationFn =
- [](OperationContext*, MultiApplier::OperationPtrs*, SyncTail*, WorkerMultikeyPathInfo*) {
- return Status::OK();
- };
- auto writerPool = OplogApplier::makeWriterPool();
- OplogApplier::Options options(OplogApplication::Mode::kSecondary);
- SyncTail syncTail(nullptr, // observer. not required by oplogApplication().
- _consistencyMarkers.get(),
- getStorageInterface(),
- applyOperationFn,
- writerPool.get(),
- options);
-
- auto service = getServiceContext();
- auto currentReplCoord = ReplicationCoordinator::get(_opCtx.get());
- ReplicationCoordinatorSignalDrainCompleteThrows replCoord(service,
- currentReplCoord->getSettings());
- ASSERT_OK(replCoord.setFollowerMode(MemberState::RS_PRIMARY));
-
- // SyncTail::oplogApplication() creates its own OperationContext in the current thread context.
- _opCtx = {};
- auto getNextApplierBatchFn =
- [](OperationContext* opCtx,
- const OplogApplier::BatchLimits& batchLimits) -> StatusWith<OplogApplier::Operations> {
- return OplogApplier::Operations();
- };
- syncTail.oplogApplication(oplogBuffer.get(), getNextApplierBatchFn, &replCoord);
-}
-
TEST_F(IdempotencyTest, Geo2dsphereIndexFailedOnUpdate) {
ASSERT_OK(
ReplicationCoordinator::get(_opCtx.get())->setFollowerMode(MemberState::RS_RECOVERING));