azagrebin commented on a change in pull request #9813: [FLINK-14287] Decouple
leader address from LeaderContender
URL: https://github.com/apache/flink/pull/9813#discussion_r333545599
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/leaderelection/ZooKeeperLeaderElectionService.java
##########
@@ -233,15 +241,20 @@ public void isLeader() {
}
}
+ private void clearConfirmedLeaderInformation() {
+ confirmedLeaderSessionID = null;
+ confirmedLeaderAddress = null;
+ }
+
@Override
public void notLeader() {
synchronized (lock) {
if (running) {
issuedLeaderSessionID = null;
- confirmedLeaderSessionID = null;
+ clearConfirmedLeaderInformation();
if (LOG.isDebugEnabled()) {
- LOG.debug("Revoke leadership of {}.",
leaderContender.getAddress());
+ LOG.debug("Revoke leadership of {}.",
leaderContender);
}
Review comment:
I guess we want to output rather `confirmedLeaderAddress`, not
`leaderContender`
```
if (LOG.isDebugEnabled()) {
LOG.debug("Revoke leadership of {}.",
confirmedLeaderAddress);
}
clearConfirmedLeaderInformation();
```
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services