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:54:25 UTC

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

i3wangyi 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_r343843760
 
 

 ##########
 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:
   It just makes the debugging process a little easier. Plus, it only adds the time spent on the method only in addition to the existing log. The "onControllerChange" process time can be the additional weapon to figure out the remaining latency other than the method.

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