diff --git a/creator-node/src/services/stateMachineManager/stateReconciliation/updateReplicaSet.jobProcessor.ts b/creator-node/src/services/stateMachineManager/stateReconciliation/updateReplicaSet.jobProcessor.ts index da9ea835c93..4644eb0ccde 100644 --- a/creator-node/src/services/stateMachineManager/stateReconciliation/updateReplicaSet.jobProcessor.ts +++ b/creator-node/src/services/stateMachineManager/stateReconciliation/updateReplicaSet.jobProcessor.ts @@ -596,6 +596,19 @@ const _issueUpdateReplicaSetOp = async ( response.result = UpdateReplicaSetJobResult.SuccessIssueReconfigDisabled return response } + /** + * TODO: Remove this after rollout. This is an extra gating condition that only applies to primary reconfigs: + * ONLY issue reconfigs of primaries when the cause of the reconfig is that the primary endpoint was deregistered or changed. + */ + const primaryExistsOnChain = + ContentNodeInfoManager.getCNodeEndpointToSpIdMap().hasOwnProperty(primary) + const isPrimaryReconfig = + reconfigType === RECONFIG_MODES.PRIMARY_AND_OR_SECONDARIES + const shouldSkipPrimaryReconfig = isPrimaryReconfig && primaryExistsOnChain + if (shouldSkipPrimaryReconfig) { + response.result = UpdateReplicaSetJobResult.SuccessIssueReconfigDisabled + return response + } // Create new array of replica set spIds and write to URSM for (const endpt of newReplicaSetEndpoints) {