Skip to content

Commit b372e90

Browse files
[improve][conf] Change the default value of readOnlyModeOnAnyDiskFullEnabled to true (#4520)
* [improve][conf] Change the default value of readOnlyModeOnAnyDiskFullEnabled to true
1 parent d873ca4 commit b372e90

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

bookkeeper-server/src/main/java/org/apache/bookkeeper/conf/ServerConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -2462,12 +2462,12 @@ public ServerConfiguration setReadOnlyModeOnAnyDiskFullEnabled(boolean enabled)
24622462
}
24632463

24642464
/**
2465-
* Get whether read-only mode is enable when any disk is full. The default is false.
2465+
* Get whether read-only mode is enable when any disk is full. The default is true.
24662466
*
24672467
* @return boolean
24682468
*/
24692469
public boolean isReadOnlyModeOnAnyDiskFullEnabled() {
2470-
return getBoolean(READ_ONLY_MODE_ON_ANY_DISK_FULL_ENABLED, false);
2470+
return getBoolean(READ_ONLY_MODE_ON_ANY_DISK_FULL_ENABLED, true);
24712471
}
24722472

24732473
/**

bookkeeper-server/src/test/java/org/apache/bookkeeper/bookie/LedgerDirsManagerTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ public void testLedgerDirsMonitorHandlingWithMultipleLedgerDirectories() throws
414414
// one dir usagespace above storagethreshold, another dir below storagethreshold
415415
// should still be writable
416416
setUsageAndThenVerify(curDir1, nospace + 0.02f, curDir2, nospace - 0.05f, mockDiskChecker,
417-
mockLedgerDirsListener, false);
417+
mockLedgerDirsListener, true);
418418

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

444444
// bring both the dirs below lwm

bookkeeper-server/src/test/java/org/apache/bookkeeper/test/ReadOnlyBookieTest.java

+1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ public void testBookieShouldServeAsReadOnly() throws Exception {
103103
public void testBookieShouldTurnWritableFromReadOnly() throws Exception {
104104
killBookie(0);
105105
baseConf.setReadOnlyModeEnabled(true);
106+
baseConf.setReadOnlyModeOnAnyDiskFullEnabled(false);
106107
baseConf.setDiskCheckInterval(Integer.MAX_VALUE);
107108
startNewBookie();
108109
LedgerHandle ledger = bkc.createLedger(2, 2, DigestType.MAC,

conf/bk_server.conf

+2-2
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ extraServerComponents=
181181
# If "readOnlyModeOnAnyDiskFullEnabled=true" then on any ledger disks full, bookie will be converted
182182
# to read-only mode and serve only read requests. When all disks recovered,
183183
# the bookie will be converted to read-write mode.Otherwise it will obey the `readOnlyModeEnabled` behavior.
184-
# By default this will be disabled.
185-
# readOnlyModeOnAnyDiskFullEnabled=false
184+
# By default this will be enable.
185+
# readOnlyModeOnAnyDiskFullEnabled=true
186186

187187
#############################################################################
188188
## Netty server settings

0 commit comments

Comments
 (0)