-
Notifications
You must be signed in to change notification settings - Fork 909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the bookie doesn't transition to writable #4225
base: master
Are you sure you want to change the base?
Conversation
--- ### Motivation When bookie started with readonly, and the disk usage is small than the warning threshold, it won't transition to write mode. Notify the disk writable when init the bookie
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bookie starts with ReadOnly has three cases:
- Case 1: Bookie starts in ReadOnly mode by startup command
- Case 2: Bookie transmits to ReadOnly mode due to disk usage before the restart, and the ReadOnly mode persists in storage. The next time, it starts with the ReadOnly mode
- Case 3: Bookie changed to ReadOnly mode by REST API and persisted the ReadOnly mode to storage before the restart. In the next time, it starts with ReadOnly mode.
In this PR, you add the notify flag in the init stage, which means the bookie starts with ReadOnly mode, but if disk usage is below the disk WARN threshold, it will transmit to ReadWrite mode. It fixes some situations in Case 2, but it will change the behavior of Case 1 and Case 3.
For the first case, I think if you start bookie with readonly, the bookie will in forceReadonly and won't be writable anymore. So even if the disk has space and it won't transition to the write mode. For the third case, yes. It is very difficult to know if it is controlled by the rest API or the disk threshold for now. So if you want to make bookie into readonly forever, you need to make it to the forceReadonly, not the readonly state. So i think it should be acceptable? |
Motivation
When bookie started with readonly, and the disk usage is smaller than the warning threshold, it won't transition to write mode. Notify the disk writable when init the bookie