Hi, Bookkeeper Community At present, when the bookie registered session expired, the RegistrationManager listener of BookieStateManager will re-register the service state of bookie in the Registration service, including writable and read-only, but this simple re-registration state may make the bookie service in an inconsistent state, bookie It's hard to recover from this (had to recreate the zk client + redo all initialization steps for all subcomponents), like @dlg99's comment at https://github.com/apache/bookkeeper/issues/3250#issuecomment-1190996890.
I want to provide a session expired policy to choose whether it should continue to reconnect or shutdown directlly. Proposal PR - https://github.com/apache/bookkeeper/pull/3495 Because Bookie is difficult to recover from Session Expired. So the reconnect policy is still a policy to be implemented and verified. reconnect was introduced to keep the same logic as before. We can use another PR to implement the complete policy of Bookie Reconnect Recovery from Session Expired. Here I divide it into three steps: 1. This PR introduces two policy options 2. Change the default policy to shutdown to solve flaky-test fix Flaky-test: https://github.com/apache/bookkeeper/pull/3418 3. Implement complete bookie recovery logic for the reconnect policy. What do you think about it? Thanks. Wenbing