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

[improve][conf] Change the default value of readOnlyModeOnAnyDiskFullEnabled to true #4520

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2462,12 +2462,12 @@ public ServerConfiguration setReadOnlyModeOnAnyDiskFullEnabled(boolean enabled)
}

/**
* Get whether read-only mode is enable when any disk is full. The default is false.
* Get whether read-only mode is enable when any disk is full. The default is true.
*
* @return boolean
*/
public boolean isReadOnlyModeOnAnyDiskFullEnabled() {
return getBoolean(READ_ONLY_MODE_ON_ANY_DISK_FULL_ENABLED, false);
return getBoolean(READ_ONLY_MODE_ON_ANY_DISK_FULL_ENABLED, true);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ public void testLedgerDirsMonitorHandlingWithMultipleLedgerDirectories() throws
// one dir usagespace above storagethreshold, another dir below storagethreshold
// should still be writable
setUsageAndThenVerify(curDir1, nospace + 0.02f, curDir2, nospace - 0.05f, mockDiskChecker,
mockLedgerDirsListener, false);
mockLedgerDirsListener, true);

// should remain readonly
setUsageAndThenVerify(curDir1, nospace + 0.05f, curDir2, nospace + 0.02f, mockDiskChecker,
Expand All @@ -438,7 +438,7 @@ public void testLedgerDirsMonitorHandlingWithMultipleLedgerDirectories() throws
// overall diskusage is less than lwm
// should goto readwrite
setUsageAndThenVerify(curDir1, lwm - 0.17f, curDir2, nospace + 0.03f, mockDiskChecker, mockLedgerDirsListener,
false);
true);
assertEquals("Only one LedgerDir should be writable", 1, dirsManager.getWritableLedgerDirs().size());

// bring both the dirs below lwm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public void testBookieShouldServeAsReadOnly() throws Exception {
public void testBookieShouldTurnWritableFromReadOnly() throws Exception {
killBookie(0);
baseConf.setReadOnlyModeEnabled(true);
baseConf.setReadOnlyModeOnAnyDiskFullEnabled(false);
baseConf.setDiskCheckInterval(Integer.MAX_VALUE);
startNewBookie();
LedgerHandle ledger = bkc.createLedger(2, 2, DigestType.MAC,
Expand Down
4 changes: 2 additions & 2 deletions conf/bk_server.conf
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ extraServerComponents=
# If "readOnlyModeOnAnyDiskFullEnabled=true" then on any ledger disks full, bookie will be converted
# to read-only mode and serve only read requests. When all disks recovered,
# the bookie will be converted to read-write mode.Otherwise it will obey the `readOnlyModeEnabled` behavior.
# By default this will be disabled.
# readOnlyModeOnAnyDiskFullEnabled=false
# By default this will be enable.
# readOnlyModeOnAnyDiskFullEnabled=true

#############################################################################
## Netty server settings
Expand Down