xyuanlu commented on code in PR #2585:
URL: https://github.com/apache/helix/pull/2585#discussion_r1295143697
##########
meta-client/src/main/java/org/apache/helix/metaclient/recipes/leaderelection/LeaderElectionClient.java:
##########
@@ -404,6 +416,25 @@ public void handleConnectionEstablishmentError(Throwable
error) throws Exception
}
}
+ private void touchLeaderNode() {
+ for (String leaderPath : _leaderGroups) {
+ String key = leaderPath;
+ ImmutablePair<LeaderInfo, MetaClientInterface.Stat> tup =
_metaClient.getDataAndStat(key);
+ if (tup.left.getLeaderName().equalsIgnoreCase(_participant)) {
+ int expectedVersion = tup.right.getVersion();
+ try {
+ _metaClient.set(key, tup.left, expectedVersion);
Review Comment:
Had an offline discussion. This will not cause data overwrite or other eace
condition as we are using `set()` with expected version.
--
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]