rahulrane50 commented on code in PR #2553:
URL: https://github.com/apache/helix/pull/2553#discussion_r1259048264


##########
helix-core/src/main/java/org/apache/helix/controller/stages/TopStateHandoffReportStage.java:
##########
@@ -469,16 +475,17 @@ private void 
reportTopStateComesBack(ResourceControllerDataProvider cache, Map<S
       }
     }
 
+    long duration = handOffEndTime - handOffStartTime;
+    long helixLatency = duration - fromTopStateUserLatency - 
toTopStateUserLatency;
+    // It is possible that during controller leader switch, we lost previous 
master information
+    // and use current time to approximate missing top state start time. If we 
see the actual
+    // user latency is larger than the duration we estimated, we use user 
latency to start with
+    duration = Math.max(duration, helixLatency);
+    boolean isGraceful = record.isGracefulHandoff();
+    logMissingTopStateInfo(duration, helixLatency, isGraceful, 
partition.getPartitionName());
+    // TODO: Following threshold check can be removed and stats can be 
reported even if hand-off took more than
+    //  threshold.
     if (handOffStartTime > 0 && handOffEndTime - handOffStartTime <= 
threshold) {

Review Comment:
   Yes I didn’t make any changes in logs so it should be same as what they were 
using before. I made minor changes in log statement in above code path as we 
don’t have any handoff duration to report(because handoff has not completed yet)



##########
helix-core/src/main/java/org/apache/helix/controller/stages/TopStateHandoffReportStage.java:
##########
@@ -469,16 +475,17 @@ private void 
reportTopStateComesBack(ResourceControllerDataProvider cache, Map<S
       }
     }
 
+    long duration = handOffEndTime - handOffStartTime;
+    long helixLatency = duration - fromTopStateUserLatency - 
toTopStateUserLatency;
+    // It is possible that during controller leader switch, we lost previous 
master information
+    // and use current time to approximate missing top state start time. If we 
see the actual
+    // user latency is larger than the duration we estimated, we use user 
latency to start with
+    duration = Math.max(duration, helixLatency);
+    boolean isGraceful = record.isGracefulHandoff();
+    logMissingTopStateInfo(duration, helixLatency, isGraceful, 
partition.getPartitionName());
+    // TODO: Following threshold check can be removed and stats can be 
reported even if hand-off took more than
+    //  threshold.
     if (handOffStartTime > 0 && handOffEndTime - handOffStartTime <= 
threshold) {

Review Comment:
   Yes I didn’t make any changes in logs so it should be same as what they were 
using before. I made minor changes in log statement in above code path as we 
don’t have any handoff duration to report(because handoff has not completed yet)



-- 
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]

Reply via email to