summaryrefslogtreecommitdiff
path: root/src/mongo/db/s
diff options
context:
space:
mode:
authorJason Chan <jason.chan@mongodb.com>2021-10-19 18:40:08 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-10-26 18:22:07 +0000
commitf47995bdb089be4beb4d0bb4e277f097df064087 (patch)
tree4277cbc2a9e81e635910eb6227a2d05bd334352c /src/mongo/db/s
parent1cf0b1f960473c325f41a004a787560e71cd84b1 (diff)
downloadmongo-f47995bdb089be4beb4d0bb4e277f097df064087.tar.gz
SERVER-60509 onReplicationRollback should crash on failure
Diffstat (limited to 'src/mongo/db/s')
-rw-r--r--src/mongo/db/s/config_server_op_observer.cpp4
-rw-r--r--src/mongo/db/s/config_server_op_observer.h4
-rw-r--r--src/mongo/db/s/resharding/resharding_op_observer.h7
-rw-r--r--src/mongo/db/s/shard_server_op_observer.cpp4
-rw-r--r--src/mongo/db/s/shard_server_op_observer.h6
5 files changed, 12 insertions, 13 deletions
diff --git a/src/mongo/db/s/config_server_op_observer.cpp b/src/mongo/db/s/config_server_op_observer.cpp
index 4bc0616ddab..fe73090a366 100644
--- a/src/mongo/db/s/config_server_op_observer.cpp
+++ b/src/mongo/db/s/config_server_op_observer.cpp
@@ -95,8 +95,8 @@ repl::OpTime ConfigServerOpObserver::onDropCollection(OperationContext* opCtx,
return {};
}
-void ConfigServerOpObserver::onReplicationRollback(OperationContext* opCtx,
- const RollbackObserverInfo& rbInfo) noexcept {
+void ConfigServerOpObserver::_onReplicationRollback(OperationContext* opCtx,
+ const RollbackObserverInfo& rbInfo) {
if (rbInfo.configServerConfigVersionRolledBack) {
// Throw out any cached information related to the cluster ID.
ShardingCatalogManager::get(opCtx)->discardCachedConfigDatabaseInitializationState();
diff --git a/src/mongo/db/s/config_server_op_observer.h b/src/mongo/db/s/config_server_op_observer.h
index b9f12804a2d..53e54132952 100644
--- a/src/mongo/db/s/config_server_op_observer.h
+++ b/src/mongo/db/s/config_server_op_observer.h
@@ -197,13 +197,11 @@ public:
void onTransactionAbort(OperationContext* opCtx,
boost::optional<OplogSlot> abortOplogEntryOpTime) override {}
- void onReplicationRollback(OperationContext* opCtx,
- const RollbackObserverInfo& rbInfo) noexcept;
-
void onMajorityCommitPointUpdate(ServiceContext* service,
const repl::OpTime& newCommitPoint) override;
private:
+ void _onReplicationRollback(OperationContext* opCtx, const RollbackObserverInfo& rbInfo);
void _registerTopologyTimeTickPoint(Timestamp newTopologyTime);
void _tickTopologyTimeIfNecessary(ServiceContext* service, Timestamp newCommitPointTime);
diff --git a/src/mongo/db/s/resharding/resharding_op_observer.h b/src/mongo/db/s/resharding/resharding_op_observer.h
index 941e1aa3c59..4b786ee2796 100644
--- a/src/mongo/db/s/resharding/resharding_op_observer.h
+++ b/src/mongo/db/s/resharding/resharding_op_observer.h
@@ -217,11 +217,12 @@ public:
void onTransactionAbort(OperationContext* opCtx,
boost::optional<OplogSlot> abortOplogEntryOpTime) override {}
- void onReplicationRollback(OperationContext* opCtx,
- const RollbackObserverInfo& rbInfo) noexcept override {}
-
void onMajorityCommitPointUpdate(ServiceContext* service,
const repl::OpTime& newCommitPoint) override {}
+
+private:
+ void _onReplicationRollback(OperationContext* opCtx,
+ const RollbackObserverInfo& rbInfo) override {}
};
} // namespace mongo
diff --git a/src/mongo/db/s/shard_server_op_observer.cpp b/src/mongo/db/s/shard_server_op_observer.cpp
index a8f83636cf0..d483a8184ed 100644
--- a/src/mongo/db/s/shard_server_op_observer.cpp
+++ b/src/mongo/db/s/shard_server_op_observer.cpp
@@ -641,8 +641,8 @@ void ShardServerOpObserver::onCollMod(OperationContext* opCtx,
abortOngoingMigrationIfNeeded(opCtx, nss);
};
-void ShardServerOpObserver::onReplicationRollback(OperationContext* opCtx,
- const RollbackObserverInfo& rbInfo) noexcept {
+void ShardServerOpObserver::_onReplicationRollback(OperationContext* opCtx,
+ const RollbackObserverInfo& rbInfo) {
if (rbInfo.rollbackNamespaces.find(NamespaceString::kCollectionCriticalSectionsNamespace) !=
rbInfo.rollbackNamespaces.end()) {
RecoverableCriticalSectionService::get(opCtx)->recoverRecoverableCriticalSections(opCtx);
diff --git a/src/mongo/db/s/shard_server_op_observer.h b/src/mongo/db/s/shard_server_op_observer.h
index 7447298320b..34fbb1a6ebf 100644
--- a/src/mongo/db/s/shard_server_op_observer.h
+++ b/src/mongo/db/s/shard_server_op_observer.h
@@ -196,11 +196,11 @@ public:
void onTransactionAbort(OperationContext* opCtx,
boost::optional<OplogSlot> abortOplogEntryOpTime) override {}
- void onReplicationRollback(OperationContext* opCtx,
- const RollbackObserverInfo& rbInfo) noexcept;
-
void onMajorityCommitPointUpdate(ServiceContext* service,
const repl::OpTime& newCommitPoint) override {}
+
+private:
+ void _onReplicationRollback(OperationContext* opCtx, const RollbackObserverInfo& rbInfo);
};
} // namespace mongo