Skip to content

Conversation

@guihecheng
Copy link
Contributor

What changes were proposed in this pull request?

When use placement policy to choose datanodes, we should check whether a datanode has a volume that
has enough space to hold the container, not check the space from all volumes together, because a container
could only be on a single volume not spread across volumes.

What is the link to the Apache JIRA

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

How was this patch tested?

extended existing ut.

@guihecheng
Copy link
Contributor Author

Hi @ChenSammi please help review this one, I'll check the CI failures, not related at first glance, thanks~

@ChenSammi
Copy link
Contributor

Hi @guihecheng , we have leverage the DatanodeInfo value. It seems there is no need to add new API in NodeManager. You can refer to these piece of codes,

final DatanodeInfo datanodeInfo = nodeStateManager
.getNode(datanodeDetails);
final List storageReportProtos = datanodeInfo
.getStorageReports();
for (StorageReportProto reportProto : storageReportProtos) {
capacity += reportProto.getCapacity();
used += reportProto.getScmUsed();
remaining += reportProto.getRemaining();
}

@guihecheng
Copy link
Contributor Author

@ChenSammi ah, then I shall put the logic directly into hasEnoughSpace and avoid adding a new API, thanks~

@guihecheng guihecheng force-pushed the HDDS-5209 branch 3 times, most recently from a9fc6b3 to d9299c5 Compare May 14, 2021 06:30
@guihecheng
Copy link
Contributor Author

guihecheng commented May 14, 2021

@ChenSammi updated, thanks~
cc @bshashikant , please help review this since it can be related to datanode volume handling issues.

@ChenSammi
Copy link
Contributor

+1. Thanks @guihecheng for the contribution.

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