fantapsody opened a new pull request #2799:
URL: https://github.com/apache/bookkeeper/pull/2799


   ### Motivation
   
   This PR is a part of the work to improve the process of removing bookies 
from the cluster. Specifically, it implements the `readOnly` API described in 
the 
[mail](http://mail-archives.apache.org/mod_mbox/bookkeeper-dev/202109.mbox/raw/%3CCAJdLeK03g8K0h6swn%3D9yVP1Ze2zHxe8TDobK6a-zpTdABkeQEA%40mail.gmail.com%3E).
   
   ### Changes
   
   - Add an REST API at `/api/v1/bookie/state/readonly`
     - The `GET` method returns the current `readOnly` status
     - The `PUT` method updates the `readOnly` status if needed.
       - The dirs monitoring will be shutdown when the bookie is updated to 
readOnly to avoid the state from being updated to writable by the monitoring 
service.
       - The dirs monitoring will be started again when the bookie is updated 
to writable.
   - Expose methods `startDirsMonitoring` and `shutdownDirsMonitoring` in 
`Bookie` and make them idempotent.
   
   ### TODOs
   
   - Update the document once the PR is accepted.
   - Update the `BookieStateManager` & `BookieImpl` to persist the information 
that the state change is triggered by the external API request and do not start 
the dirs monitoring if the state is readOnly.


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