Skip to content

Commit 0f811d4

Browse files
authored
HDDS-15127. Add a switch to toggle the RocksDb open test for volume health (#10149)
1 parent f71c648 commit 0f811d4

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/DatanodeConfiguration.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,14 @@ public class DatanodeConfiguration extends ReconfigurableConfig {
384384
)
385385
private boolean isDiskCheckEnabled = true;
386386

387+
@Config(key = "hdds.datanode.disk.check.rocksdb.check.io.test.enabled",
388+
defaultValue = "true",
389+
type = ConfigType.BOOLEAN,
390+
tags = {DATANODE},
391+
description = "The configuration to enable or disable RocksDb disk IO checks."
392+
)
393+
private boolean isRocksDbDiskCheckEnabled = true;
394+
387395
@Config(key = "hdds.datanode.disk.check.io.failures.tolerated",
388396
defaultValue = "1",
389397
type = ConfigType.INT,
@@ -1013,6 +1021,10 @@ public boolean isDiskCheckEnabled() {
10131021
return isDiskCheckEnabled;
10141022
}
10151023

1024+
public boolean isRocksDbDiskCheckEnabled() {
1025+
return isRocksDbDiskCheckEnabled;
1026+
}
1027+
10161028
public Duration getDiskCheckSlidingWindowTimeout() {
10171029
return diskCheckSlidingWindowTimeout;
10181030
}

hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/HddsVolume.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ public synchronized VolumeCheckResult check(@Nullable Boolean unused)
306306

307307
@VisibleForTesting
308308
public VolumeCheckResult checkDbHealth(File dbFile) throws InterruptedException {
309-
if (!getDiskCheckEnabled()) {
309+
if (!(getDiskCheckEnabled() && getDatanodeConfig().isRocksDbDiskCheckEnabled())) {
310310
return VolumeCheckResult.HEALTHY;
311311
}
312312

0 commit comments

Comments
 (0)