Skip to content

Commit 96f2a1a

Browse files
committed
SERVER-34658 Don't throw an exception inside a ScopeGuard in the MovePrimarySourceManager
1 parent fb9e6ec commit 96f2a1a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/mongo/db/s/move_primary_source_manager.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -324,14 +324,14 @@ void MovePrimarySourceManager::cleanupOnError(OperationContext* opCtx) {
324324
return;
325325
}
326326

327-
uassertStatusOK(Grid::get(opCtx)->catalogClient()->logChange(
328-
opCtx,
329-
"movePrimary.error",
330-
_dbname.toString(),
331-
_buildMoveLogEntry(_dbname.toString(), _fromShard.toString(), _toShard.toString()),
332-
ShardingCatalogClient::kMajorityWriteConcern));
333-
334327
try {
328+
uassertStatusOK(Grid::get(opCtx)->catalogClient()->logChange(
329+
opCtx,
330+
"movePrimary.error",
331+
_dbname.toString(),
332+
_buildMoveLogEntry(_dbname.toString(), _fromShard.toString(), _toShard.toString()),
333+
ShardingCatalogClient::kMajorityWriteConcern));
334+
335335
_cleanup(opCtx);
336336
} catch (const ExceptionForCat<ErrorCategory::NotMasterError>& ex) {
337337
BSONObjBuilder requestArgsBSON;

0 commit comments

Comments
 (0)