csudharsanan commented on code in PR #3043:
URL: https://github.com/apache/helix/pull/3043#discussion_r2151026359
##########
helix-core/src/main/java/org/apache/helix/controller/stages/MessageGenerationPhase.java:
##########
@@ -163,6 +163,32 @@ private void generateMessage(final Resource resource,
final BaseControllerDataPr
// desired-state->list of generated-messages
Map<String, List<Message>> messageMap = new HashMap<>();
+ /**
+ * Calculate the current active replica count based on state model type.
+ * This represents the number of replicas currently serving traffic for
this partition
+ * Active replicas include: top states, secondary top states (for
single-top state models),
+ * and ERROR states.
+ * All qualifying state transitions for this partition will receive this
same value,
+ * allowing clients to understand the current availability level and
prioritize accordingly.
+ */
+ int currentActiveReplicaCount;
+ if (stateModelDef.isSingleTopStateModel()) {
+ // For single-top state models (e.g., OFFLINE→STANDBY→ONLINE)
Review Comment:
Thanks for pointing this out @xyuanlu. I've updated the logic and added some
tests.
Also, reformatted the previous tests when i added the new ones.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]