Github user hanm commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/447#discussion_r205629046
--- Diff:
src/java/main/org/apache/zookeeper/server/quorum/LeaderSessionTracker.java ---
@@ -85,31 +85,43 @@ public boolean isGlobalSession(long sessionId) {
return globalSessionTracker.isTrackingSession(sessionId);
}
- public boolean addGlobalSession(long sessionId, int sessionTimeout) {
- boolean added =
- globalSessionTracker.addSession(sessionId, sessionTimeout);
- if (localSessionsEnabled && added) {
+ public boolean trackSession(long sessionId, int sessionTimeout) {
+ boolean tracked =
+ globalSessionTracker.trackSession(sessionId, sessionTimeout);
+ if (localSessionsEnabled && tracked) {
// Only do extra logging so we know what kind of session this
is
// if we're supporting both kinds of sessions
- LOG.info("Adding global session 0x" +
Long.toHexString(sessionId));
+ LOG.info("Tracking global session 0x" +
Long.toHexString(sessionId));
}
- return added;
+ return tracked;
}
- public boolean addSession(long sessionId, int sessionTimeout) {
- boolean added;
- if (localSessionsEnabled && !isGlobalSession(sessionId)) {
- added = localSessionTracker.addSession(sessionId,
sessionTimeout);
--- End diff --
With this being removed, how would a `LeaderSessionTracker` now add (or
track, with the new term) a new local session (when local session is enabled on
Leader server)? The `LeaderSessionTracker.trackSession` does not track local
session.
---