You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by "desaikomal (via GitHub)" <gi...@apache.org> on 2023/06/01 22:19:36 UTC

[GitHub] [helix] desaikomal commented on a diff in pull request #2514: MissingTopState when the leader comes back on the same host

desaikomal commented on code in PR #2514:
URL: https://github.com/apache/helix/pull/2514#discussion_r1213736645


##########
helix-core/src/main/java/org/apache/helix/controller/stages/TopStateHandoffReportStage.java:
##########
@@ -218,6 +217,8 @@ private void reportTopStateExistence(ResourceControllerDataProvider cache, Curre
       // we observed an entire top state handoff process
       reportSingleTopStateHandoff(cache, lastTopStateInstance, currentTopStateInstance,

Review Comment:
   i can do that optimization but i had concern with this code: 
       // Make sure last top state instance has not bounced during cluster data cache refresh
       if (cache.getLiveInstances().containsKey(lastTopStateInstance)) {
         String lastTopStateSession =
             cache.getLiveInstances().get(lastTopStateInstance).getEphemeralOwner();
         // We need this null check as there are test cases creating incomplete current state
         if (cache.getCurrentState(lastTopStateInstance, lastTopStateSession).get(resourceName)
             != null) {
           startTime =
               cache.getCurrentState(lastTopStateInstance, lastTopStateSession).get(resourceName)
                   .getStartTime(partition.getPartitionName());
           fromTopStateUserLatency =
               cache.getCurrentState(lastTopStateInstance, lastTopStateSession).get(resourceName)
                   .getEndTime(partition.getPartitionName()) - startTime;
         }
       }
   
   So i wanted to first make sure change works properly and then optimize it but code de-dup. i can combine the two into one change.
   
   let me know what you would prefer. i prefer the current approach but i am ready to hear reviewers choice too.
   thanks,



-- 
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: reviews-unsubscribe@helix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org