You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2019/11/07 19:39:44 UTC

[GitHub] [helix] jiajunwang commented on a change in pull request #576: Minor log optimization for easily investigating mastership handoff latency

jiajunwang commented on a change in pull request #576: Minor log optimization for easily investigating mastership handoff latency
URL: https://github.com/apache/helix/pull/576#discussion_r343833523
 
 

 ##########
 File path: helix-core/src/main/java/org/apache/helix/manager/zk/DistributedLeaderElection.java
 ##########
 @@ -87,36 +88,39 @@ public synchronized void onControllerChange(NotificationContext changeContext) {
 
   private void relinquishLeadership(HelixManager manager,
       ControllerManagerHelper controllerHelper) {
-    LOG.info(manager.getInstanceName() + " relinquish leadership for cluster: " + manager
+    long start = System.currentTimeMillis();
+    LOG.info(manager.getInstanceName() + " tries to relinquish leadership for cluster: " + manager
         .getClusterName());
     controllerHelper.stopControllerTimerTasks();
     controllerHelper.removeListenersFromController(_controller);
     // clear write-through cache
     manager.getHelixDataAccessor().getBaseDataAccessor().reset();
+    LOG.info("{} relinquishes leadership for cluster: {}, took: {}", manager.getInstanceName(),
 
 Review comment:
   Correct me if I am wrong, I think we record every "onControllerChange" processing time. So it should be easy to derive the latency from that log. I feel this log would be redundant a little bit.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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