HDDS-14871. DataNode: tolerate per-volume health-check latch timeouts before marking volumes failed.#9954
Open
devmadhuu wants to merge 3 commits intoapache:masterfrom
Open
HDDS-14871. DataNode: tolerate per-volume health-check latch timeouts before marking volumes failed.#9954devmadhuu wants to merge 3 commits intoapache:masterfrom
devmadhuu wants to merge 3 commits intoapache:masterfrom
Conversation
… before marking volumes failed.
ChenSammi
reviewed
Mar 24, 2026
...ner-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/StorageVolume.java
Outdated
Show resolved
Hide resolved
ChenSammi
reviewed
Mar 24, 2026
...vice/src/main/java/org/apache/hadoop/ozone/container/common/volume/StorageVolumeChecker.java
Show resolved
Hide resolved
ChenSammi
reviewed
Mar 26, 2026
| public static final String FAILED_DB_VOLUMES_TOLERATED_KEY = "hdds.datanode.failed.db.volumes.tolerated"; | ||
| public static final String DISK_CHECK_MIN_GAP_KEY = "hdds.datanode.disk.check.min.gap"; | ||
| public static final String DISK_CHECK_TIMEOUT_KEY = "hdds.datanode.disk.check.timeout"; | ||
|
|
Contributor
There was a problem hiding this comment.
Please revert this change.
ChenSammi
reviewed
Mar 26, 2026
| * meaning the volume should now be marked FAILED; {@code false} if | ||
| * the failure is still within tolerance this round. | ||
| */ | ||
| public synchronized boolean recordTimeoutAsIOFailure() { |
Contributor
There was a problem hiding this comment.
check is synchronized. So if timeout, check doesn't return, then this recordTimeoutAsIOFailure will wait for check to complete.
ChenSammi
reviewed
Mar 26, 2026
| if (t instanceof InterruptedException) { | ||
| return; | ||
| } | ||
| if (exception instanceof TimeoutException) { |
Contributor
There was a problem hiding this comment.
Devesh, can you add a unit test of real timeout case for both check all volume and check one volume? The exception thrown out from ListenableFuture is not direct TimeoutException in my test.
ChenSammi
reviewed
Mar 26, 2026
| if (!volume.recordTimeoutAsIOFailure()) { | ||
| // Within tolerance this round. Still call cleanup() so numVolumes | ||
| // decrements correctly and the latch/callback fires on time. | ||
| cleanup(); |
Contributor
There was a problem hiding this comment.
one of the callback of checkVolume is
volumeChecker.checkVolume(
volume, (healthyVolumes, failedVolumes) -> {
if (!failedVolumes.isEmpty()) {
LOG.warn("checkVolumeAsync callback got {} failed volumes: {}",
failedVolumes.size(), failedVolumes);
} else {
LOG.debug("checkVolumeAsync: no volume failures detected");
}
handleVolumeFailures(failedVolumes);
})
We need to consider whether call the cleanup in this case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
This PR addresses the problem of latch timeout for pending volumes not reported any result.
StorageVolumeChecker.checkAllVolumes()waits on a singleCountDownLatchfor all volume health checks to complete. If the latch expires before any volume finishes — due to any transient stall — every pending volume is immediately marked FAILED with zero tolerance, producing false-positive volume failures.The existing per-volume IO-failure sliding window in
StorageVolume.check()does not address this because it only applies when a check completes, not when the latch times out.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-14871
How was this patch tested?
This patch has been tested by extending 3 unit tests in existing test class :
TestStorageVolumeHealthChecks