Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

zymap
Copy link
Member

@zymap zymap commented Mar 6, 2024


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

image

---

### 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
@zymap zymap self-assigned this Mar 6, 2024
@zymap zymap added this to the 4.17.0 milestone Mar 6, 2024
Copy link
Contributor

@hangc0276 hangc0276 left a 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.

@zymap
Copy link
Member Author

zymap commented Mar 8, 2024

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?

@mattisonchao
Copy link
Member

image Do we need safe run here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants