summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/repl')
-rw-r--r--src/mongo/db/repl/abstract_async_component_test.cpp2
-rw-r--r--src/mongo/db/repl/collection_cloner_test.cpp10
-rw-r--r--src/mongo/db/repl/database_cloner.cpp2
-rw-r--r--src/mongo/db/repl/database_cloner_test.cpp14
-rw-r--r--src/mongo/db/repl/databases_cloner_test.cpp12
-rw-r--r--src/mongo/db/repl/initial_syncer_test.cpp4
-rw-r--r--src/mongo/db/repl/master_slave.cpp12
-rw-r--r--src/mongo/db/repl/multiapplier_test.cpp10
-rw-r--r--src/mongo/db/repl/oplog.cpp4
-rw-r--r--src/mongo/db/repl/reporter_test.cpp12
-rw-r--r--src/mongo/db/repl/roll_back_local_operations_test.cpp4
-rw-r--r--src/mongo/db/repl/rollback_checker_test.cpp3
-rw-r--r--src/mongo/db/repl/rs_rollback_no_uuid_test.cpp4
-rw-r--r--src/mongo/db/repl/rs_rollback_test.cpp4
-rw-r--r--src/mongo/db/repl/storage_interface_impl.cpp2
-rw-r--r--src/mongo/db/repl/storage_interface_impl_test.cpp2
-rw-r--r--src/mongo/db/repl/sync_source_resolver_test.cpp12
-rw-r--r--src/mongo/db/repl/sync_tail_test.cpp5
-rw-r--r--src/mongo/db/repl/task_runner_test.cpp2
19 files changed, 57 insertions, 63 deletions
diff --git a/src/mongo/db/repl/abstract_async_component_test.cpp b/src/mongo/db/repl/abstract_async_component_test.cpp
index 9d82755bafd..db0571fc940 100644
--- a/src/mongo/db/repl/abstract_async_component_test.cpp
+++ b/src/mongo/db/repl/abstract_async_component_test.cpp
@@ -181,7 +181,7 @@ void AbstractAsyncComponentTest::tearDown() {
TEST_F(AbstractAsyncComponentTest, ConstructorThrowsUserAssertionOnNullTaskExecutor) {
ASSERT_THROWS_CODE_AND_WHAT(MockAsyncComponent(nullptr),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"task executor cannot be null");
}
diff --git a/src/mongo/db/repl/collection_cloner_test.cpp b/src/mongo/db/repl/collection_cloner_test.cpp
index d3e8966a304..bca11a5e03a 100644
--- a/src/mongo/db/repl/collection_cloner_test.cpp
+++ b/src/mongo/db/repl/collection_cloner_test.cpp
@@ -138,7 +138,7 @@ TEST_F(CollectionClonerTest, InvalidConstruction) {
si,
defaultBatchSize,
defaultNumCloningCursors),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"task executor cannot be null");
}
@@ -153,7 +153,7 @@ TEST_F(CollectionClonerTest, InvalidConstruction) {
nullptr,
defaultBatchSize,
defaultNumCloningCursors),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"storage interface cannot be null");
@@ -170,7 +170,7 @@ TEST_F(CollectionClonerTest, InvalidConstruction) {
si,
defaultBatchSize,
defaultNumCloningCursors),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"invalid collection namespace: db.");
}
@@ -191,7 +191,7 @@ TEST_F(CollectionClonerTest, InvalidConstruction) {
si,
defaultBatchSize,
defaultNumCloningCursors),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"'storageEngine.storageEngine1' has to be an embedded document.");
}
@@ -209,7 +209,7 @@ TEST_F(CollectionClonerTest, InvalidConstruction) {
si,
defaultBatchSize,
defaultNumCloningCursors),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"callback function cannot be null");
}
diff --git a/src/mongo/db/repl/database_cloner.cpp b/src/mongo/db/repl/database_cloner.cpp
index bc7ea109918..f6b3cc030ba 100644
--- a/src/mongo/db/repl/database_cloner.cpp
+++ b/src/mongo/db/repl/database_cloner.cpp
@@ -369,7 +369,7 @@ void DatabaseCloner::_listCollectionsCallback(const StatusWith<Fetcher::QueryRes
_storageInterface,
collectionClonerBatchSize,
maxNumInitialSyncCollectionClonerCursors.load());
- } catch (const UserException& ex) {
+ } catch (const AssertionException& ex) {
_finishCallback_inlock(lk, ex.toStatus());
return;
}
diff --git a/src/mongo/db/repl/database_cloner_test.cpp b/src/mongo/db/repl/database_cloner_test.cpp
index 593090f9ae0..d586221398c 100644
--- a/src/mongo/db/repl/database_cloner_test.cpp
+++ b/src/mongo/db/repl/database_cloner_test.cpp
@@ -136,21 +136,21 @@ TEST_F(DatabaseClonerTest, InvalidConstruction) {
// Null executor -- error from Fetcher, not _databaseCloner.
ASSERT_THROWS_CODE_AND_WHAT(
DatabaseCloner(nullptr, dbWorkThreadPool.get(), target, dbname, filter, pred, si, ccb, cb),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"task executor cannot be null");
// Null db worker thread pool.
ASSERT_THROWS_CODE_AND_WHAT(
DatabaseCloner(&executor, nullptr, target, dbname, filter, pred, si, ccb, cb),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"db worker thread pool cannot be null");
// Empty database name -- error from Fetcher, not _databaseCloner.
ASSERT_THROWS_CODE_AND_WHAT(
DatabaseCloner(&executor, dbWorkThreadPool.get(), target, "", filter, pred, si, ccb, cb),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"database name in remote command request cannot be empty");
@@ -158,7 +158,7 @@ TEST_F(DatabaseClonerTest, InvalidConstruction) {
ASSERT_THROWS_CODE_AND_WHAT(
DatabaseCloner(
&executor, dbWorkThreadPool.get(), target, dbname, filter, pred, si, ccb, nullptr),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"callback function cannot be null");
@@ -166,7 +166,7 @@ TEST_F(DatabaseClonerTest, InvalidConstruction) {
ASSERT_THROWS_CODE_AND_WHAT(
DatabaseCloner(
&executor, dbWorkThreadPool.get(), target, dbname, filter, pred, nullptr, ccb, cb),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"storage interface cannot be null");
@@ -174,7 +174,7 @@ TEST_F(DatabaseClonerTest, InvalidConstruction) {
ASSERT_THROWS_CODE_AND_WHAT(
DatabaseCloner(
&executor, dbWorkThreadPool.get(), target, dbname, filter, pred, si, nullptr, cb),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"collection callback function cannot be null");
@@ -182,7 +182,7 @@ TEST_F(DatabaseClonerTest, InvalidConstruction) {
ASSERT_THROWS_CODE_AND_WHAT(
DatabaseCloner(
&executor, dbWorkThreadPool.get(), target, dbname, filter, pred, si, ccb, nullptr),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"callback function cannot be null");
}
diff --git a/src/mongo/db/repl/databases_cloner_test.cpp b/src/mongo/db/repl/databases_cloner_test.cpp
index 533198f9e66..58664a44907 100644
--- a/src/mongo/db/repl/databases_cloner_test.cpp
+++ b/src/mongo/db/repl/databases_cloner_test.cpp
@@ -352,7 +352,7 @@ TEST_F(DBsClonerTest, InvalidConstruction) {
ASSERT_THROWS_CODE_AND_WHAT(
DatabasesCloner(
nullptr, &getExecutor(), &getDbWorkThreadPool(), source, includeDbPred, finishFn),
- UserException,
+ AssertionException,
ErrorCodes::InvalidOptions,
"storage interface must be provided.");
@@ -360,14 +360,14 @@ TEST_F(DBsClonerTest, InvalidConstruction) {
ASSERT_THROWS_CODE_AND_WHAT(
DatabasesCloner(
&getStorage(), nullptr, &getDbWorkThreadPool(), source, includeDbPred, finishFn),
- UserException,
+ AssertionException,
ErrorCodes::InvalidOptions,
"executor must be provided.");
// Null db worker thread pool.
ASSERT_THROWS_CODE_AND_WHAT(
DatabasesCloner(&getStorage(), &getExecutor(), nullptr, source, includeDbPred, finishFn),
- UserException,
+ AssertionException,
ErrorCodes::InvalidOptions,
"db worker thread pool must be provided.");
@@ -375,7 +375,7 @@ TEST_F(DBsClonerTest, InvalidConstruction) {
ASSERT_THROWS_CODE_AND_WHAT(
DatabasesCloner(
&getStorage(), &getExecutor(), &getDbWorkThreadPool(), {}, includeDbPred, finishFn),
- UserException,
+ AssertionException,
ErrorCodes::InvalidOptions,
"source must be provided.");
@@ -383,7 +383,7 @@ TEST_F(DBsClonerTest, InvalidConstruction) {
ASSERT_THROWS_CODE_AND_WHAT(
DatabasesCloner(
&getStorage(), &getExecutor(), &getDbWorkThreadPool(), source, {}, finishFn),
- UserException,
+ AssertionException,
ErrorCodes::InvalidOptions,
"includeDbPred must be provided.");
@@ -391,7 +391,7 @@ TEST_F(DBsClonerTest, InvalidConstruction) {
ASSERT_THROWS_CODE_AND_WHAT(
DatabasesCloner(
&getStorage(), &getExecutor(), &getDbWorkThreadPool(), source, includeDbPred, {}),
- UserException,
+ AssertionException,
ErrorCodes::InvalidOptions,
"finishFn must be provided.");
}
diff --git a/src/mongo/db/repl/initial_syncer_test.cpp b/src/mongo/db/repl/initial_syncer_test.cpp
index 033af4a4ad6..dbc94f0095e 100644
--- a/src/mongo/db/repl/initial_syncer_test.cpp
+++ b/src/mongo/db/repl/initial_syncer_test.cpp
@@ -542,7 +542,7 @@ TEST_F(InitialSyncerTest, InvalidConstruction) {
_storageInterface.get(),
_replicationProcess.get(),
callback),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"task executor cannot be null");
}
@@ -556,7 +556,7 @@ TEST_F(InitialSyncerTest, InvalidConstruction) {
_storageInterface.get(),
_replicationProcess.get(),
InitialSyncer::OnCompletionFn()),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"callback function cannot be null");
}
diff --git a/src/mongo/db/repl/master_slave.cpp b/src/mongo/db/repl/master_slave.cpp
index 1567d6dc603..da01612154e 100644
--- a/src/mongo/db/repl/master_slave.cpp
+++ b/src/mongo/db/repl/master_slave.cpp
@@ -646,7 +646,7 @@ void ReplSource::applyCommand(OperationContext* opCtx, const BSONObj& op) {
try {
Status status = applyCommand_inlock(opCtx, op, true);
uassert(28639, "Failure applying initial sync command", status.isOK());
- } catch (UserException& e) {
+ } catch (AssertionException& e) {
log() << "sync: caught user assertion " << redact(e) << " while applying op: " << redact(op)
<< endl;
;
@@ -673,7 +673,7 @@ void ReplSource::applyOperation(OperationContext* opCtx, Database* db, const BSO
sync.setHostname(hostName);
sync.fetchAndInsertMissingDocument(opCtx, op);
}
- } catch (UserException& e) {
+ } catch (AssertionException& e) {
log() << "sync: caught user assertion " << redact(e) << " while applying op: " << redact(op)
<< endl;
;
@@ -1209,14 +1209,6 @@ int _replMain(OperationContext* opCtx, ReplSource::SourceVector& sources, int& n
} catch (const SyncException&) {
log() << "caught SyncException" << endl;
return 10;
- } catch (AssertionException& e) {
- if (e.severe()) {
- log() << "replMain AssertionException " << redact(e) << endl;
- return 60;
- } else {
- log() << "AssertionException " << redact(e) << endl;
- }
- replInfo = "replMain caught AssertionException";
} catch (const DBException& e) {
log() << "DBException " << redact(e) << endl;
replInfo = "replMain caught DBException";
diff --git a/src/mongo/db/repl/multiapplier_test.cpp b/src/mongo/db/repl/multiapplier_test.cpp
index a031064130b..95e737bac0e 100644
--- a/src/mongo/db/repl/multiapplier_test.cpp
+++ b/src/mongo/db/repl/multiapplier_test.cpp
@@ -83,7 +83,7 @@ TEST_F(MultiApplierTest, InvalidConstruction) {
// Null executor.
ASSERT_THROWS_CODE_AND_WHAT(
MultiApplier(nullptr, operations, applyOperation, multiApply, callback),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"null replication executor");
@@ -91,7 +91,7 @@ TEST_F(MultiApplierTest, InvalidConstruction) {
ASSERT_THROWS_CODE_AND_WHAT(
MultiApplier(
&getExecutor(), MultiApplier::Operations(), applyOperation, multiApply, callback),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"empty list of operations");
@@ -99,7 +99,7 @@ TEST_F(MultiApplierTest, InvalidConstruction) {
ASSERT_THROWS_CODE_AND_WHAT(
MultiApplier(
&getExecutor(), operations, MultiApplier::ApplyOperationFn(), multiApply, callback),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"apply operation function cannot be null");
@@ -107,7 +107,7 @@ TEST_F(MultiApplierTest, InvalidConstruction) {
ASSERT_THROWS_CODE_AND_WHAT(
MultiApplier(
&getExecutor(), operations, applyOperation, MultiApplier::MultiApplyFn(), callback),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"multi apply function cannot be null");
@@ -115,7 +115,7 @@ TEST_F(MultiApplierTest, InvalidConstruction) {
ASSERT_THROWS_CODE_AND_WHAT(
MultiApplier(
&getExecutor(), operations, applyOperation, multiApply, MultiApplier::CallbackFn()),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"callback function cannot be null");
}
diff --git a/src/mongo/db/repl/oplog.cpp b/src/mongo/db/repl/oplog.cpp
index 0e7f873fcfd..e7e6de49b11 100644
--- a/src/mongo/db/repl/oplog.cpp
+++ b/src/mongo/db/repl/oplog.cpp
@@ -571,7 +571,7 @@ void createOplog(OperationContext* opCtx, const std::string& oplogCollectionName
ss << "cmdline oplogsize (" << n << ") different than existing (" << o
<< ") see: http://dochub.mongodb.org/core/increase-oplog";
log() << ss.str() << endl;
- throw UserException(13257, ss.str());
+ throw AssertionException(13257, ss.str());
}
}
@@ -1134,7 +1134,7 @@ Status applyOperation_inlock(OperationContext* opCtx,
}
} else {
invariant(*opType != 'c'); // commands are processed in applyCommand_inlock()
- throw MsgAssertionException(
+ throw AssertionException(
14825, str::stream() << "error in applyOperation : unknown opType " << *opType);
}
diff --git a/src/mongo/db/repl/reporter_test.cpp b/src/mongo/db/repl/reporter_test.cpp
index f0261d64f5f..97485f030e5 100644
--- a/src/mongo/db/repl/reporter_test.cpp
+++ b/src/mongo/db/repl/reporter_test.cpp
@@ -248,13 +248,13 @@ TEST_F(ReporterTestNoTriggerAtSetUp, InvalidConstruction) {
Reporter::PrepareReplSetUpdatePositionCommandFn(),
HostAndPort("h1"),
Milliseconds(1000)),
- UserException);
+ AssertionException);
// null TaskExecutor
ASSERT_THROWS_WHAT(
Reporter(
nullptr, prepareReplSetUpdatePositionCommandFn, HostAndPort("h1"), Milliseconds(1000)),
- UserException,
+ AssertionException,
"null task executor");
// null PrepareReplSetUpdatePositionCommandFn
@@ -262,7 +262,7 @@ TEST_F(ReporterTestNoTriggerAtSetUp, InvalidConstruction) {
Reporter::PrepareReplSetUpdatePositionCommandFn(),
HostAndPort("h1"),
Milliseconds(1000)),
- UserException,
+ AssertionException,
"null function to create replSetUpdatePosition command object");
// empty HostAndPort
@@ -270,21 +270,21 @@ TEST_F(ReporterTestNoTriggerAtSetUp, InvalidConstruction) {
prepareReplSetUpdatePositionCommandFn,
HostAndPort(),
Milliseconds(1000)),
- UserException,
+ AssertionException,
"target name cannot be empty");
// zero keep alive interval.
ASSERT_THROWS_WHAT(
Reporter(
&getExecutor(), prepareReplSetUpdatePositionCommandFn, HostAndPort("h1"), Seconds(-1)),
- UserException,
+ AssertionException,
"keep alive interval must be positive");
// negative keep alive interval.
ASSERT_THROWS_WHAT(
Reporter(
&getExecutor(), prepareReplSetUpdatePositionCommandFn, HostAndPort("h1"), Seconds(-1)),
- UserException,
+ AssertionException,
"keep alive interval must be positive");
}
diff --git a/src/mongo/db/repl/roll_back_local_operations_test.cpp b/src/mongo/db/repl/roll_back_local_operations_test.cpp
index 71abee20b72..93f70d07268 100644
--- a/src/mongo/db/repl/roll_back_local_operations_test.cpp
+++ b/src/mongo/db/repl/roll_back_local_operations_test.cpp
@@ -61,14 +61,14 @@ TEST(RollBackLocalOperationsTest, InvalidLocalOplogIterator) {
} invalidOplog;
ASSERT_THROWS_CODE(
RollBackLocalOperations(invalidOplog, [](const BSONObj&) { return Status::OK(); }),
- UserException,
+ AssertionException,
ErrorCodes::BadValue);
}
TEST(RollBackLocalOperationsTest, InvalidRollbackOperationFunction) {
ASSERT_THROWS_CODE(RollBackLocalOperations(OplogInterfaceMock({makeOpAndRecordId(1, 0)}),
RollBackLocalOperations::RollbackOperationFn()),
- UserException,
+ AssertionException,
ErrorCodes::BadValue);
}
diff --git a/src/mongo/db/repl/rollback_checker_test.cpp b/src/mongo/db/repl/rollback_checker_test.cpp
index 985a0f59a96..3f9ae14266c 100644
--- a/src/mongo/db/repl/rollback_checker_test.cpp
+++ b/src/mongo/db/repl/rollback_checker_test.cpp
@@ -78,7 +78,8 @@ TEST_F(RollbackCheckerTest, InvalidConstruction) {
HostAndPort syncSource;
// Null executor.
- ASSERT_THROWS_CODE(RollbackChecker(nullptr, syncSource), UserException, ErrorCodes::BadValue);
+ ASSERT_THROWS_CODE(
+ RollbackChecker(nullptr, syncSource), AssertionException, ErrorCodes::BadValue);
}
TEST_F(RollbackCheckerTest, ShutdownBeforeStart) {
diff --git a/src/mongo/db/repl/rs_rollback_no_uuid_test.cpp b/src/mongo/db/repl/rs_rollback_no_uuid_test.cpp
index 8107507d487..2b4f239c54c 100644
--- a/src/mongo/db/repl/rs_rollback_no_uuid_test.cpp
+++ b/src/mongo/db/repl/rs_rollback_no_uuid_test.cpp
@@ -212,7 +212,7 @@ TEST_F(RSRollbackTest, RemoteGetRollbackIdThrows) {
_coordinator,
_replicationProcess.get())
.transitional_ignore(),
- UserException,
+ AssertionException,
ErrorCodes::UnknownError);
}
@@ -237,7 +237,7 @@ TEST_F(RSRollbackTest, RemoteGetRollbackIdDiffersFromRequiredRBID) {
_coordinator,
_replicationProcess.get())
.transitional_ignore(),
- UserException,
+ AssertionException,
ErrorCodes::Error(40362));
}
diff --git a/src/mongo/db/repl/rs_rollback_test.cpp b/src/mongo/db/repl/rs_rollback_test.cpp
index 99f18f723ea..6555843ad26 100644
--- a/src/mongo/db/repl/rs_rollback_test.cpp
+++ b/src/mongo/db/repl/rs_rollback_test.cpp
@@ -300,7 +300,7 @@ TEST_F(RSRollbackTest, RemoteGetRollbackIdThrows) {
_coordinator,
_replicationProcess.get())
.transitional_ignore(),
- UserException,
+ AssertionException,
ErrorCodes::UnknownError);
}
@@ -324,7 +324,7 @@ TEST_F(RSRollbackTest, RemoteGetRollbackIdDiffersFromRequiredRBID) {
_coordinator,
_replicationProcess.get())
.transitional_ignore(),
- UserException,
+ AssertionException,
ErrorCodes::Error(40506));
}
diff --git a/src/mongo/db/repl/storage_interface_impl.cpp b/src/mongo/db/repl/storage_interface_impl.cpp
index 3b0059f9c04..f532e5aa361 100644
--- a/src/mongo/db/repl/storage_interface_impl.cpp
+++ b/src/mongo/db/repl/storage_interface_impl.cpp
@@ -392,7 +392,7 @@ Status StorageInterfaceImpl::createCollection(OperationContext* opCtx,
try {
auto coll = db->createCollection(opCtx, nss.ns(), options);
invariant(coll);
- } catch (const UserException& ex) {
+ } catch (const AssertionException& ex) {
return ex.toStatus();
}
wuow.commit();
diff --git a/src/mongo/db/repl/storage_interface_impl_test.cpp b/src/mongo/db/repl/storage_interface_impl_test.cpp
index acea2cd4571..5e6ba445814 100644
--- a/src/mongo/db/repl/storage_interface_impl_test.cpp
+++ b/src/mongo/db/repl/storage_interface_impl_test.cpp
@@ -1908,7 +1908,7 @@ TEST_F(StorageInterfaceImplTest,
BSON("" << 1).firstElement(),
BSON("$unknownUpdateOp" << BSON("x" << 1000)))
.transitional_ignore(),
- UserException,
+ AssertionException,
ErrorCodes::FailedToParse,
"Unknown modifier: $unknownUpdateOp");
}
diff --git a/src/mongo/db/repl/sync_source_resolver_test.cpp b/src/mongo/db/repl/sync_source_resolver_test.cpp
index 48bdf70f13c..77154e62ae6 100644
--- a/src/mongo/db/repl/sync_source_resolver_test.cpp
+++ b/src/mongo/db/repl/sync_source_resolver_test.cpp
@@ -158,7 +158,7 @@ TEST_F(SyncSourceResolverTest, InvalidConstruction) {
// Null task executor.
ASSERT_THROWS_CODE_AND_WHAT(
SyncSourceResolver(nullptr, &selector, lastOpTimeFetched, requiredOpTime, onCompletion),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"task executor cannot be null");
@@ -166,14 +166,14 @@ TEST_F(SyncSourceResolverTest, InvalidConstruction) {
ASSERT_THROWS_CODE_AND_WHAT(
SyncSourceResolver(
&getExecutor(), nullptr, lastOpTimeFetched, requiredOpTime, onCompletion),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"sync source selector cannot be null");
// Null last fetched optime.
ASSERT_THROWS_CODE_AND_WHAT(
SyncSourceResolver(&getExecutor(), &selector, OpTime(), requiredOpTime, onCompletion),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"last fetched optime cannot be null");
@@ -183,7 +183,7 @@ TEST_F(SyncSourceResolverTest, InvalidConstruction) {
lastOpTimeFetched,
OpTime(Timestamp(Seconds(50), 1U), 1LL),
onCompletion),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"required optime (if provided) must be more recent than last "
"fetched optime. requiredOpTime: { ts: Timestamp 50000|1, t: 1 }, "
@@ -191,7 +191,7 @@ TEST_F(SyncSourceResolverTest, InvalidConstruction) {
ASSERT_THROWS_CODE_AND_WHAT(
SyncSourceResolver(
&getExecutor(), &selector, lastOpTimeFetched, lastOpTimeFetched, onCompletion),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"required optime (if provided) must be more recent than last fetched optime. "
"requiredOpTime: { ts: Timestamp 100000|1, t: 1 }, lastOpTimeFetched: { ts: Timestamp "
@@ -203,7 +203,7 @@ TEST_F(SyncSourceResolverTest, InvalidConstruction) {
lastOpTimeFetched,
requiredOpTime,
SyncSourceResolver::OnCompletionFn()),
- UserException,
+ AssertionException,
ErrorCodes::BadValue,
"callback function cannot be null");
}
diff --git a/src/mongo/db/repl/sync_tail_test.cpp b/src/mongo/db/repl/sync_tail_test.cpp
index 37d85269b96..b34d74bec32 100644
--- a/src/mongo/db/repl/sync_tail_test.cpp
+++ b/src/mongo/db/repl/sync_tail_test.cpp
@@ -218,8 +218,9 @@ TEST_F(SyncTailTest, SyncApplyNoOpApplyOpThrowsException) {
}
TEST_F(SyncTailTest, SyncApplyInsertDocumentDatabaseMissing) {
- ASSERT_THROWS_CODE(
- _testSyncApplyInsertDocument(ErrorCodes::OK), UserException, ErrorCodes::NamespaceNotFound);
+ ASSERT_THROWS_CODE(_testSyncApplyInsertDocument(ErrorCodes::OK),
+ AssertionException,
+ ErrorCodes::NamespaceNotFound);
}
TEST_F(SyncTailTest, SyncApplyInsertDocumentCollectionMissing) {
diff --git a/src/mongo/db/repl/task_runner_test.cpp b/src/mongo/db/repl/task_runner_test.cpp
index 62b64513b37..d2f9d3440e0 100644
--- a/src/mongo/db/repl/task_runner_test.cpp
+++ b/src/mongo/db/repl/task_runner_test.cpp
@@ -48,7 +48,7 @@ using Task = TaskRunner::Task;
TEST_F(TaskRunnerTest, InvalidConstruction) {
// Null thread pool.
ASSERT_THROWS_CODE_AND_WHAT(
- TaskRunner(nullptr), UserException, ErrorCodes::BadValue, "null thread pool");
+ TaskRunner(nullptr), AssertionException, ErrorCodes::BadValue, "null thread pool");
}
TEST_F(TaskRunnerTest, GetDiagnosticString) {