wenbingshen opened a new pull request, #3495:
URL: https://github.com/apache/bookkeeper/pull/3495

   ### Motivation
   The status of the Bookie service, including `writable` and `read-only`, 
needs to be registered with the `Registration` service.
   At present, most of the time we use `zookeeper` as the `Registration` 
service, where `BookieStateManager` is mainly responsible for managing these 
state switches, including the  `re-registration` logic after processing the 
`session expired event`.
   `BookieStateManager` uses `ZKRegistrationManager` to register the state, 
where `zk` in `ZKRegistrationManager` is a subclass of `Zookeeper` to implement 
`ZooKeeperClient`. When `session expired` occurs,`ZooKeeperClient` will 
re-instantiate a new `Zookeeper` for `zk`.
   If the new `zk` is successfully constructed, the `BookieStateManager` will 
re-register the bookie state with zookeeper server.
   
   Here we have a problem, from the existing unit tests and the actual show, we 
seem to want the bookie to be closed when the session expired occurs, because 
we can't prove whether the bookie can be in the correct working state just by 
reinitializing a new zk, refer to comments on the following issue: 
https://github.com/apache/bookkeeper/issues/3250#issuecomment-1190996890
   
   Like pulsar, we can provide session expired poilicy to choose whether it 
should continue to reconnect.
   
   ### Changes
   Add `RegistrationSessionExpiredPolicy` and server-side configuration items: 
`registrationSessionExpiredPolicy`
   Contains two optional values:  `reconnect, shutdown`
   
   To stay consistent with the existing logic, this PR will set the policy to 
`reconnect`.
   
   If we want to solve the problem mentioned in #3418 , we can modify the 
policy to shutdown here at #3418.
   


-- 
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]

Reply via email to