Skip to content

HDDS-9273. Set CapacityVolumeChoosingPolicy as default VolumeChoosingPolicy.#5285

Merged
sumitagrawl merged 2 commits intoapache:masterfrom
sadanand48:HDDS-9273
Sep 22, 2023
Merged

HDDS-9273. Set CapacityVolumeChoosingPolicy as default VolumeChoosingPolicy.#5285
sumitagrawl merged 2 commits intoapache:masterfrom
sadanand48:HDDS-9273

Conversation

@sadanand48
Copy link
Contributor

What changes were proposed in this pull request?

Current default is round robin which won't take into account the space on the volume while creating/replicating containers which can cause allocate block failures (although they would be retried) or lead to small containers. It is better to make CapacityVolumeChoosingPolicy as default.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-9273

How was this patch tested?

Unit test

@sadanand48 sadanand48 requested a review from sodonnel September 14, 2023 14:45
Copy link
Contributor

@swamirishi swamirishi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sadanand48 Thanks for the patch. Overall changes look good. Had nitpicky changes.

volumeChoosingPolicy = conf.getClass(
HDDS_DATANODE_VOLUME_CHOOSING_POLICY, RoundRobinVolumeChoosingPolicy
.class, VolumeChoosingPolicy.class).newInstance();
volumeChoosingPolicy = VolumeChoosingPolicyFactory.getPolicy(conf);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there a need for a volumeChoosingFactory here? Can't we just add the DEFAULT_VOLUME_CHOOSING_POLICY in a constant class?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Classes inside org.apache.hadoop.ozone.container.common.volume can't be accessed in HDDSConfigKeys as the common module doesn't depend on the container-service module. The other way is to hardcode the class name as a string but this might pose a problem if some one changes the location of the class.

Just checked Even Container placement policy uses a factory class to get its impls.

Copy link
Contributor

@ChenSammi ChenSammi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sadanand48 , the patch LGTM, +1.

Copy link
Contributor

@sumitagrawl sumitagrawl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sadanand48 Thanks for working over this, LGTM +1

@sumitagrawl sumitagrawl merged commit 38cb0e7 into apache:master Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants