adoroszlai commented on code in PR #8119:
URL: https://github.com/apache/ozone/pull/8119#discussion_r2006952755
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/DatanodeConfiguration.java:
##########
@@ -719,6 +750,39 @@ public void validate() {
rocksdbDeleteObsoleteFilesPeriod =
ROCKSDB_DELETE_OBSOLETE_FILES_PERIOD_MICRO_SECONDS_DEFAULT;
}
+
+ validateMinFreeSpace();
+ }
+
+ /**
+ * If 'hdds.datanode.volume.min.free.space' is defined,
+ * it will be honored first. If it is not defined and
+ * 'hdds.datanode.volume.min.free.space.percent' is defined, it will honor
this
+ * else it will fall back to 'hdds.datanode.volume.min.free.space.default'
+ */
+ private void validateMinFreeSpace() {
+ if (minFreeSpaceRatio > 1) {
+ LOG.warn("{} = {} is invalid, should be between 0 and 1",
+ HDDS_DATANODE_VOLUME_MIN_FREE_SPACE_PERCENT, minFreeSpaceRatio);
+ minFreeSpaceRatio = MIN_FREE_SPACE_UNSET;
+ }
+
+ final boolean minFreeSpaceConfigured = minFreeSpace >= 0;
+ final boolean minFreeSpaceRatioConfigured = minFreeSpaceRatio >= 0;
+
+ if (minFreeSpaceConfigured && minFreeSpaceRatioConfigured) {
Review Comment:
I don't really want to mix logic change with refactoring. We could tweak it
in a dedicated task. While it would be a small code change in this place,
tests also need to be updated, and the title "refactoring" would hide it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]