[
https://issues.apache.org/jira/browse/HDDS-16386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Navin Kumar updated HDDS-16386:
-------------------------------
Description:
NodeDecommissionManager re-reads the two maintenance configuration values as raw
string keys with hardcoded default values, instead of using the
ReplicationManagerConfiguration where they are defined:
{code:java}
setMaintenanceConfigs(config.getInt("hdds.scm.replication.maintenance.replica.minimum",
2),
config.getInt("hdds.scm.replication.maintenance.remaining.redundancy", 1));
{code}
The keys "hdds.scm.replication.maintenance.replica.minimum" and
"hdds.scm.replication.maintenance.remaining.redundancy", along with their
default
values (2 and 1), are already defined in
ReplicationManager.ReplicationManagerConfiguration.
Since the NodeDecommissionManager constructor already receives the
ReplicationManager
instance, We can get these values directly from rm.getConfig(), making
ReplicationManagerConfiguration the single source of truth.
{code:java}
ReplicationManager.ReplicationManagerConfiguration rmConf = rm.getConfig();
setMaintenanceConfigs(rmConf.getMaintenanceReplicaMinimum(),
rmConf.getMaintenanceRemainingRedundancy());
{code}
was:
NodeDecommissionManager re-reads the two maintenance configuration values as raw
string keys with hardcoded default values, instead of using the
ReplicationManagerConfiguration where they are defined:
{code:java}
setMaintenanceConfigs(config.getInt("hdds.scm.replication.maintenance.replica.minimum",
2),
config.getInt("hdds.scm.replication.maintenance.remaining.redundancy", 1));
{code}
The keys "hdds.scm.replication.maintenance.replica.minimum" and
"hdds.scm.replication.maintenance.remaining.redundancy", along with their
default
values (2 and 1), are already defined in
ReplicationManager.ReplicationManagerConfiguration.
Duplicating both the key names
and the defaults here means the two locations can silently drift if the
canonical
defaults or keys are ever changed.
Since the NodeDecommissionManager constructor already receives the
ReplicationManager
instance, We can get these values directly from rm.getConfig(), making
ReplicationManagerConfiguration the single source of truth.
Proposed change
{code:java}
ReplicationManager.ReplicationManagerConfiguration rmConf = rm.getConfig();
setMaintenanceConfigs(rmConf.getMaintenanceReplicaMinimum(),
rmConf.getMaintenanceRemainingRedundancy());
{code}
> NodeDecommissionManager should read maintenance replica config from
> ReplicationManagerConfiguration
> ---------------------------------------------------------------------------------------------------
>
> Key: HDDS-16386
> URL: https://issues.apache.org/jira/browse/HDDS-16386
> Project: Apache Ozone
> Issue Type: Improvement
> Components: SCM
> Reporter: Navin Kumar
> Assignee: Navin Kumar
> Priority: Minor
>
> NodeDecommissionManager re-reads the two maintenance configuration values as
> raw
> string keys with hardcoded default values, instead of using the
> ReplicationManagerConfiguration where they are defined:
> {code:java}
> setMaintenanceConfigs(config.getInt("hdds.scm.replication.maintenance.replica.minimum",
> 2),
> config.getInt("hdds.scm.replication.maintenance.remaining.redundancy",
> 1));
> {code}
> The keys "hdds.scm.replication.maintenance.replica.minimum" and
> "hdds.scm.replication.maintenance.remaining.redundancy", along with their
> default
> values (2 and 1), are already defined in
> ReplicationManager.ReplicationManagerConfiguration.
> Since the NodeDecommissionManager constructor already receives the
> ReplicationManager
> instance, We can get these values directly from rm.getConfig(), making
> ReplicationManagerConfiguration the single source of truth.
> {code:java}
> ReplicationManager.ReplicationManagerConfiguration rmConf = rm.getConfig();
> setMaintenanceConfigs(rmConf.getMaintenanceReplicaMinimum(),
> rmConf.getMaintenanceRemainingRedundancy());
> {code}
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]