Conversation
…onfig from ReplicationManagerConfiguration
chihsuan
left a comment
There was a problem hiding this comment.
Thanks for the cleanup! @navinko LGTM +1
Just curious, since both keys are reconfigurable and only ReplicationManager picks up a reconfig today, could checkIfMaintenancePossible read rmConf directly instead of copying the values? Happy to see that as a follow-up too. Left a small nit inline.
| // Read the maintenance replica config from ReplicationManagerConfiguration, | ||
| // which is the single source of truth for these values. |
There was a problem hiding this comment.
nit: Could we drop this comment? The code already says where the values come from.
| // Read the maintenance replica config from ReplicationManagerConfiguration, | |
| // which is the single source of truth for these values. |
There was a problem hiding this comment.
Thank you! Removed the comment.
Thanks @chihsuan for the review. |
What changes were proposed in this pull request?
NodeDecommissionManager was reading the two maintenance settings as keys with hardcoded default values:
Those keys and defaults (2 and 1) are already defined in ReplicationManager.ReplicationManagerConfiguration, so they were duplicated in two places. Since the constructor already receives the ReplicationManager instance, this PR reads them from rm.getConfig(), making ReplicationManagerConfiguration the single source of truth.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-16386
How was this patch tested?
#Added new unit test -
TestNodeDecommissionManager#testMaintenanceConfigsReadFromReplicationManagerConfiguration — verifies the values comes from ReplicationManagerConfiguration.
#Updated existing unit test -
TestDeletedBlockLog to have getConfig stub, otherwise passing it as null causing NPE which results test failure.
Successful CI - https://github.com/navinko/ozone/actions/runs/35424869985