Github user lvfangmin commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/447#discussion_r161296493
--- Diff:
src/java/main/org/apache/zookeeper/server/PrepRequestProcessor.java ---
@@ -579,13 +579,8 @@ protected void pRequest2Txn(int type, long zxid,
Request request,
int to = request.request.getInt();
request.setTxn(new CreateSessionTxn(to));
request.request.rewind();
- if (request.isLocalSession()) {
- // This will add to local session tracker if it is
enabled
- zks.sessionTracker.addSession(request.sessionId, to);
- } else {
- // Explicitly add to global session if the flag is not
set
- zks.sessionTracker.addGlobalSession(request.sessionId,
to);
- }
+ // only add the global session tracker but not to ZKDb
+ zks.sessionTracker.addGlobalSession(request.sessionId, to);
--- End diff --
On LeaderSessionTracker, we need to differentiate add local session or
global session, but since we only call createSession when add local session, I
think I can simplify the interface more by removing addGlobalSession and rename
addSession to trackSession.
---