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

validate diskUsageThreshold and diskUsageLwmThreshold #3285

Merged
merged 7 commits into from
Jul 26, 2022

Conversation

wenbingshen
Copy link
Member

Motivation

When diskUsageThreshold < diskUsageLwmThreshold, the bookie can be started normally. When the disk usage reaches diskUsageThreshold , bookie will automatically switch to ReadOnly mode. The LedgerDirsMonitor then switches the bookie back to read-write mode since the disk usage is less than diskUsageLwmThreshold, the bookie will switch state back and forth frequently.

Changes

When creating LedgerDirsMonitor, we need to validate diskUsageThreshold and diskUsageLwmThreshold first.

@wenbingshen
Copy link
Member Author

rerun failure checks

1 similar comment
@wenbingshen
Copy link
Member Author

rerun failure checks

@wenbingshen
Copy link
Member Author

@dlg99 @eolivelli @zymap @shoothzj Can you help take a look at this pr? Thanks.

@wenbingshen
Copy link
Member Author

PTAL @zymap Thanks.

@hangc0276
Copy link
Contributor

rerun failure checks

@wenbingshen
Copy link
Member Author

Merge master to trigger CI test flaky test again.

@wenbingshen
Copy link
Member Author

@hangc0276 There are two frequent flaky tests: #3206 #2665.

Another flaky test seems to be related to the timeout of the bookie service shutdown, which has nothing to do with this PR, we can analyze and solve this flaky test in another PR.

Flakes: 
Warning:  org.apache.bookkeeper.bookie.StateManagerTest.testReadOnlyBookieTransitions
Error:    Run 1: StateManagerTest.testReadOnlyBookieTransitions:173->Object.wait:-2 » TestTimedOut

@wenbingshen
Copy link
Member Author

rerun failure checks

8 similar comments
@wenbingshen
Copy link
Member Author

rerun failure checks

@wenbingshen
Copy link
Member Author

rerun failure checks

@wenbingshen
Copy link
Member Author

rerun failure checks

@wenbingshen
Copy link
Member Author

rerun failure checks

@wenbingshen
Copy link
Member Author

rerun failure checks

@wenbingshen
Copy link
Member Author

rerun failure checks

@wenbingshen
Copy link
Member Author

rerun failure checks

@wenbingshen
Copy link
Member Author

rerun failure checks

@wenbingshen
Copy link
Member Author

rerun failure checks

@wenbingshen
Copy link
Member Author

rerun failure checks

@@ -229,5 +231,18 @@ private void checkDirs(final LedgerDirsManager ldm)
}
ldm.getWritableLedgerDirs();
}

@VisibleForTesting
void setDiskSpaceThreshold(float diskSpaceThreshold, float diskUsageLwmThreshold) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really need this method? can we instantiate a LedgerDirsMonitor to run tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense to me. I have addressed your comments. PTAL.

@wenbingshen
Copy link
Member Author

rerun failure checks

2 similar comments
@wenbingshen
Copy link
Member Author

rerun failure checks

@wenbingshen
Copy link
Member Author

rerun failure checks

@wenbingshen wenbingshen requested a review from shoothzj July 22, 2022 11:28
@hangc0276 hangc0276 requested review from eolivelli, dlg99 and zymap July 25, 2022 01:27
@hangc0276 hangc0276 added this to the 4.16.0 milestone Jul 25, 2022
@hangc0276 hangc0276 merged commit f181325 into apache:master Jul 26, 2022
zymap pushed a commit that referenced this pull request Aug 1, 2022
### Motivation

When `diskUsageThreshold < diskUsageLwmThreshold`, the bookie can be started normally. When the disk usage reaches `diskUsageThreshold` , bookie will automatically switch to `ReadOnly` mode. The `LedgerDirsMonitor` then switches the bookie back to  `read-write` mode since the disk usage is less than `diskUsageLwmThreshold`, the bookie will switch state back and forth frequently.

### Changes
When creating `LedgerDirsMonitor`, we need to validate `diskUsageThreshold` and `diskUsageLwmThreshold` first.

(cherry picked from commit f181325)
@wenbingshen wenbingshen deleted the validateLwmThreshold branch April 27, 2023 16:25
Ghatage pushed a commit to sijie/bookkeeper that referenced this pull request Jul 12, 2024
### Motivation

When `diskUsageThreshold < diskUsageLwmThreshold`, the bookie can be started normally. When the disk usage reaches `diskUsageThreshold` , bookie will automatically switch to `ReadOnly` mode. The `LedgerDirsMonitor` then switches the bookie back to  `read-write` mode since the disk usage is less than `diskUsageLwmThreshold`, the bookie will switch state back and forth frequently.

### Changes
When creating `LedgerDirsMonitor`, we need to validate `diskUsageThreshold` and `diskUsageLwmThreshold` first.
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.

4 participants