-
Notifications
You must be signed in to change notification settings - Fork 615
HDDS-12239. Volume should not be marked as unhealthy when disk full #7830
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
Changes from 10 commits
64e4685
b620c21
caaa427
4404202
49d1956
b6f9c70
354efd1
b24600f
fb07fb0
1bdcbac
a9a3b46
16e4c88
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,6 +75,7 @@ public abstract class StorageVolume | |
| // The name of the directory where temporary files used to check disk | ||
| // health are written to. This will go inside the tmp directory. | ||
| public static final String TMP_DISK_CHECK_DIR_NAME = "disk-check"; | ||
| public static final int HUNDRED_MB = 100 * 1024 * 1024; | ||
|
|
||
| /** | ||
| * Type for StorageVolume. | ||
|
|
@@ -614,6 +615,14 @@ public synchronized VolumeCheckResult check(@Nullable Boolean unused) | |
| return VolumeCheckResult.HEALTHY; | ||
| } | ||
|
|
||
| // At least some space required to check disk read/write | ||
| // If there are not enough space remaining, | ||
| // to avoid volume failure we can ignore checking disk read/write | ||
| int minimumDiskSpace = Math.max(healthCheckFileSize * 10, HUNDRED_MB); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks a little arbitrary, what's the reasoning behind these number choices? Something simple like a 2x multiplier on the file size would probably suffice.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Kept 100MB to make sure if any other WRITES are happening on volume it should not go out of space during this check and actual disk write check(still cannot guarantee though). |
||
| if (volumeInfo.get().getCurrentUsage().getAvailable() < minimumDiskSpace) { | ||
| return VolumeCheckResult.HEALTHY; | ||
|
errose28 marked this conversation as resolved.
|
||
| } | ||
|
|
||
| // Since IO errors may be intermittent, volume remains healthy until the | ||
| // threshold of failures is crossed. | ||
| boolean diskChecksPassed = DiskCheckUtil.checkReadWrite(storageDir, | ||
|
|
@@ -625,6 +634,13 @@ public synchronized VolumeCheckResult check(@Nullable Boolean unused) | |
| " interrupted."); | ||
| } | ||
|
|
||
| // As WRITE keeps happening there is probability, disk has become full during above check. | ||
| // We can check again if disk is full. If it is full, | ||
| // in this case keep volume as healthy so that READ can still be served | ||
| if (!diskChecksPassed && volumeInfo.get().getCurrentUsage().getAvailable() < minimumDiskSpace) { | ||
| return VolumeCheckResult.HEALTHY; | ||
| } | ||
|
|
||
| // Move the sliding window of IO test results forward 1 by adding the | ||
| // latest entry and removing the oldest entry from the window. | ||
| // Update the failure counter for the new window. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we end up using this value, it would be better represented as
100 * OzoneConsts.MB.