ZOOKEEPER-1147: Add support for local sessions
Review Request #8935 - Created Jan. 12, 2013 and updated
See ZOOKEEPER-1147 for high level description Implementation notes: - Local sessions don’t get persisted on disk. Existing SessionTrackerImpl is used by the leader to track global sessions. Each participant (including the leader) also has a local session tracker (which is another instance of SessionTrackerImpl) to track its local session in memory. - Each participant intercepts a request before it enters the pipeline. In order to do 2 things o Update local session to global session when it saw create ephemeral node request. Update is done by issuing a create session rquest before issuing the create request o Add local session flag to a request. So that the pipeline know that this type of request don’t need to send to the leader and wait for commit - PrepRequestProcessor (on the leader) now explicitly validate global session on create ephemeral node request. For other type of request, there is no need for session validation because the leader doesn’t know about local sessions on other machine, so the request has to go through. The correctness is preserve as long a no ephemeral node is created after session is already expired - Observer/FollowerRequestProcessor has logic to validate session. However, I believe this logic is in correct since the request is already send downstream to the CommitProcessor. The observer and the follower have no other option but to send the request to leader.
unit tests. For our internal branch, we haven't run into bugs related to local session for quite a while so it is quite stable. We enabled local session by default in all our deployment.
Diff revision 1