summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2023-05-05 16:31:14 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-05-05 21:32:30 +0000
commit0417f5dae1f8d20caec7646982a49124c2b44c5f (patch)
tree1b2403be992f6df1741c508aa9c88648fa26aabf /src/mongo/db/repl
parent07c79a03fbe63f5c9734f68d44513cc15bb5ed2a (diff)
downloadmongo-0417f5dae1f8d20caec7646982a49124c2b44c5f.tar.gz
SERVER-76563 move OpObserver rollback exception handling from inlined interface function to RollbackImpl
Diffstat (limited to 'src/mongo/db/repl')
-rw-r--r--src/mongo/db/repl/rollback_impl.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mongo/db/repl/rollback_impl.cpp b/src/mongo/db/repl/rollback_impl.cpp
index a3c193dd3b3..171c500a2fd 100644
--- a/src/mongo/db/repl/rollback_impl.cpp
+++ b/src/mongo/db/repl/rollback_impl.cpp
@@ -1356,7 +1356,15 @@ Status RollbackImpl::_triggerOpObserver(OperationContext* opCtx) {
return Status(ErrorCodes::ShutdownInProgress, "rollback shutting down");
}
LOGV2(21610, "Triggering the rollback op observer");
- opCtx->getServiceContext()->getOpObserver()->onReplicationRollback(opCtx, _observerInfo);
+
+ // Any exceptions thrown from onReplicationRollback() indicates a rollback failure that may
+ // have led us to some inconsistent on-disk or memory state, so we crash instead.
+ try {
+ opCtx->getServiceContext()->getOpObserver()->onReplicationRollback(opCtx, _observerInfo);
+ } catch (const DBException& ex) {
+ fassert(6050902, ex.toStatus());
+ }
+
return Status::OK();
}