Skip to content

Conversation

@symious
Copy link
Contributor

@symious symious commented Oct 24, 2022

What changes were proposed in this pull request?

HDDS-7233 is a big patch that is not good for review.

I will split HDDS-7233 to multi smaller tickets.

This ticket introduces the DiskBalancerService on Datanode side, while the detailed implementation of move operation will be added in other tickets.

What is the link to the Apache JIRA

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

How was this patch tested?

unit test.

@symious
Copy link
Contributor Author

symious commented Oct 24, 2022

@ChenSammi @ferhui @lokeshj1703 @siddhantsangwan @sodonnel @neils-dev @JacksonYao287 Could you help to review this PR?

LoggerFactory.getLogger(DiskBalancerConfiguration.class);

// The path where datanode diskBalancer's conf is to be written to.
public static final String HDDS_DATANODE_DISK_BALANCER_INFO_DIR =
Copy link
Contributor

Choose a reason for hiding this comment

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

These configuration properties should be put to ozone-default.xml

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lokeshj1703 Could you help to check this comment?

Copy link
Contributor

Choose a reason for hiding this comment

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

Please add comments that if this property is not defined, ozone will fallback to use meta data directory instead.

private static final Logger LOG =
LoggerFactory.getLogger(StorageVolume.class);

public static final String TMP_DIR = "tmp";
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably it makes sense to parametrize this (like hdds.datanode.replication.work.dir for example)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one should be related to another ticket, https://issues.apache.org/jira/browse/HDDS-6449.
I think we can resolve this value after HDDS-6449.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @symious , does your previous container replication improvement patch cover this part?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can not find the definition of "tmp" now, seems being removed from StorageVolume class.

Copy link
Contributor

Choose a reason for hiding this comment

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

the tmp dir defined in HDDS-6449 , in review, currently defines the tmp directory in the HddsVolume. Does it need to be defined in this the underlying base class? What was discussed in the previous patch was,

hdds/clusterID/tmp would be the best place to put it, but we need to make sure this will not affect datanode startup on downgrade.

Copy link
Contributor

Choose a reason for hiding this comment

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

@neils-dev , I think define tmp in StorageVolume is more generic than define it in HddsVolume, in case in future other types of Volume need tmp too. what do you think?

Optional<List<String>> hosts) throws IOException {
// TODO: Send message to datanodes
return new ArrayList<DatanodeAdminError>();
// check admin authorisation
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this comment is redundant

throws IOException {
// TODO: Send message to datanodes
return new ArrayList<DatanodeAdminError>();
// check admin authorisation
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this comment is redundant

throws IOException {
// TODO: Send message to datanodes
return new ArrayList<DatanodeAdminError>();
// check admin authorisation
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this comment is redundant

@symious
Copy link
Contributor Author

symious commented Oct 25, 2022

@myskov Thank you for the review. Updated the PR, please have a look.

@DaveTeng0
Copy link
Contributor

@ChenSammi @ferhui @lokeshj1703 @siddhantsangwan @sodonnel @neils-dev @JacksonYao287 Could you help to review this PR?

hey guys! Let's continue back to gradually digest this PR when we have some time! lol

public void setDiskBalancerTimeout(Duration duration) {
this.diskBalancerTimeout = duration.toMillis();
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we move all disk balancer related configuration to DiskBalancerConfiguration?

UNKNOWN = 3;
}

enum DatanodeDiskBalancerOpType{
Copy link
Contributor

Choose a reason for hiding this comment

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

DatanodeDiskBalancerOpType -> DiskBalancerOpType, consistent with DiskBalancerRunningStatus.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, please have a check.

public static final String
HDDS_DATANODE_DISK_BALANCER_CONTAINER_CHOOSING_POLICY =
"hdds.datanode.disk.balancer.container.choosing.policy";

Copy link
Contributor

Choose a reason for hiding this comment

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

Do these three property have the default value? Can they use the @config format as other properties in this file?

case update:
diskBalancerInfo.updateFromConf(diskBalancerConf);
break;
default:
Copy link
Contributor

Choose a reason for hiding this comment

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

Please throw exception here.

List<DatanodeDetails> dns;
if (hosts.isPresent()) {
dns = NodeUtils.mapHostnamesToDatanodes(nodeManager, hosts.get(),
useHostnames);
Copy link
Contributor

@ChenSammi ChenSammi Feb 7, 2023

Choose a reason for hiding this comment

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

Should avoid send command to dn which is not healthy too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, please have a check.

private boolean shouldRun;
private double threshold;
private long bandwidthInMB;
private int parallelThread;
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a field to identify the version number. In future, there could be new item added.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ChenSammi Could you share some more infor on the "version number"? I didn't quite get the idea.

Copy link
Contributor

@ChenSammi ChenSammi Feb 14, 2023

Choose a reason for hiding this comment

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

Version number is usually to support the backward compatibility.
Currently, these four properties are persistent on disk, let's say it's V1. In future, for example, to support one bandwidthInMB for night time, and one bandwidthInMB in day time, then there will be new properties need persist, it is V2.

If ozone binaries are upgraded to V2, but the on disk info file is still V1, then ozone should recognize the file format as V1 and properly handle it. With a version number persist, we can do that. You can refer to the layout version in container file.

@symious
Copy link
Contributor Author

symious commented Feb 8, 2023

does your previous container replication improvement patch cover this part?

@ChenSammi Yes, there should be many conflicts between this PR and master. I will try to do the rebase late this week.

tags = { DATANODE, ConfigTag.DISKBALANCER},
description = "The version of the disk balancer service"
)
private String diskBalancerVersion = "ONE";
Copy link
Contributor

Choose a reason for hiding this comment

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

Numeric version string would be nice (1.0). Same with Config version default value. Any particular reason it is not? Better fidelity with numeric value string.

Copy link
Contributor

@ChenSammi ChenSammi Feb 22, 2023

Choose a reason for hiding this comment

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

@symious , we don't need to expose this version as a configurable property. We can remove it in this class.


public DiskBalancerConfiguration(Optional<Double> threshold,
Optional<Long> bandwidthInMB,
Optional<Integer> parallelThread) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The DiskBalancerConfiguration constructor and state variables for configuration do not appear to include the balancePolicy configuration that is documented in the design doc. Is it an oversight? It would be great to include it in the basic framework PR and support balancePolicies, default DefaultBalancePolicy, can balance between different disk mediums.

include the following configurations:
threshold: threshold is used to calculate the volume data density to decide which datanode is empty and needs balance.
bandwidth: a parameter to control the balance speed, so that the balance job won't affect the datanode's IO performance.
parallelThreads: a parameter that determines how many balance jobs are running simultaneously.
balancePolicy: the policy to choose which disk to balance, for example, only balance between SSD disks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@neils-dev Thanks for the review.

I was preparing to add the balancePolicy part in another ticket after the basic framework.

private static final Logger LOG =
LoggerFactory.getLogger(StorageVolume.class);

public static final String TMP_DIR = "tmp";
Copy link
Contributor

Choose a reason for hiding this comment

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

the tmp dir defined in HDDS-6449 , in review, currently defines the tmp directory in the HddsVolume. Does it need to be defined in this the underlying base class? What was discussed in the previous patch was,

hdds/clusterID/tmp would be the best place to put it, but we need to make sure this will not affect datanode startup on downgrade.

@ChenSammi
Copy link
Contributor

The last patch LGTM +1.

Thanks @symious for working on this, and @myskov @neils-dev for the code review.

@ChenSammi ChenSammi merged this pull request into apache:HDDS-5713 Feb 23, 2023
symious added a commit to symious/ozone that referenced this pull request Mar 16, 2023
symious added a commit to symious/ozone that referenced this pull request Jan 29, 2024
sodonnel pushed a commit to sodonnel/hadoop-ozone that referenced this pull request Feb 1, 2024
sadanand48 pushed a commit to sadanand48/hadoop-ozone that referenced this pull request Apr 17, 2024
sadanand48 pushed a commit to sadanand48/hadoop-ozone that referenced this pull request Apr 17, 2024
ChenSammi pushed a commit to ChenSammi/ozone that referenced this pull request Feb 19, 2025
ChenSammi pushed a commit to ChenSammi/ozone that referenced this pull request Feb 20, 2025
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.

5 participants