HDDS-10720. Datanode volume DU reserved percent should have a non-zero default value. #6561
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?
Currently there are two ways to reserve space in datanode volumes:
hdds.datanode.dir.du.reserved.percent
allows specifying a percentage of the volume's space to be unused. It applies to all volumeshdds.datanode.dir.du.reserved
allows specifying a map of volume name to bytes reserved. Since it depends on a volume path, it cannot have a default value.By default Ozone should not allow datanode volumes to get 100% full. This can cause the drive to "lock up" because some operations like block delete that would free up space still need extra disk space before they can complete because they must append to the RocksDB WAL. Once encountered, such issues are difficult to resolve. Add a default value for
hdds.datanode.dir.du.reserved.percent
to prevent this from happening.A default value of
0.0001f
is currently chosen. This is 0.01% which reserves 1GB out of a 10TB volume, 1MB out of a 1TB volume, etc. Ideally we could reserve a fixed size (like 1GB) regardless of drive size, but we would need to re-work the configs before we can do that which might need more discussion. See HDDS-10721.This PR also fixes a few other bugs that prevented tests from passing after the change:
hdds.datanode.dir.du.reserved.percent
would not be used.hdds.datanode.dir.du.reserved
. This may have passed in CI but was failing due to my local filesystem setup.What is the link to the Apache JIRA
HDDS-10720
How was this patch tested?
Unit test added.