Skip to content

HDDS-15409. SCM Pipeline Add SupportedStorageTier Field#10573

Open
xichen01 wants to merge 1 commit into
apache:HDDS-11233from
xichen01:HDDS-15409
Open

HDDS-15409. SCM Pipeline Add SupportedStorageTier Field#10573
xichen01 wants to merge 1 commit into
apache:HDDS-11233from
xichen01:HDDS-15409

Conversation

@xichen01

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

SCM Pipeline Add supportedStorageTier Field

  • Set supportedStorageTier for Pipeline when the Pipeline be created
  • Pipeline can support zero or more different types of StorageTier, depending on the Volume StorageType of the Datanodes that make up the Pipeline.
    • For example, if the three Datanodes of a 3 replica Pipeline have SSD and DISK StorageType Volumes, then the Pipeline supportedStorageTier is StorageTier.SSD and StorageTier.DISK
  • The supportedStorageTier by the Pipeline is not fixed. This field will be set when the Pipeline is created and will be updated in the PipelineReportHandler and NodeReportHandler.
    • When the StorageType of the Volume of the Datanode in the Pipeline changes (for example, the Datanode configuration is manually modified), the supportedStorageTier of the Pipeline will also change

FYI:

What is the link to the Apache JIRA

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

How was this patch tested?

unit test

@xichen01

Copy link
Copy Markdown
Contributor Author

@amaliujia @greenwich @chungen0126 @ivandika3 @peterxcli Please help to review

@chungen0126 chungen0126 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @xichen01 for working on this. Left some comments

/**
* Set the storageTier supported by the pipeline.
*/
public void setSupportedStorageTier(List<StorageTier> supportedStorageTier) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Using setSupportedStorageTier here breaks the immutable design of the Pipeline class. A better approach would be to follow the existing pattern of copyWithNodesInOrder to update the pipeline's state.

}

private void updateSupportedStorageTier(DatanodeInfo datanodeInfo) {
if (scmContext.getScm() == null) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it be better to use instanceof?

Suggested change
if (scmContext.getScm() == null) {
if (scmContext.getScm() instanceof StorageContainerManager) {

datanodeInfo.getID());
}
} catch (PipelineNotFoundException e) {
LOG.debug("Reported Datanode {} pipeline {} is not found",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it be better to use the warn log level here?

Comment on lines +743 to +758
Pipeline pipeline = pipelineManager.getPipeline(pipelineId);
Set<StorageTier> currentTiers =
pipeline.getSupportedStorageTier() != null
? new HashSet<>(pipeline.getSupportedStorageTier())
: Collections.emptySet();
List<StorageTier> newSupportedTiers =
NodeUtils.getDatanodesStorageTypes(pipeline.getNodes(), this);
Set<StorageTier> newSupportedTierSet =
new HashSet<>(newSupportedTiers);
if (!currentTiers.equals(newSupportedTierSet)) {
pipeline.setSupportedStorageTier(newSupportedTiers);
LOG.info("Updated supported storage tiers for Pipeline ID {} from {} "
+ "to {} by Datanode {}",
pipeline.getId(), currentTiers, newSupportedTierSet,
datanodeInfo.getID());
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure if we should update the pipeline when processing node report. My understanding is that pipeline updates should be scoped exclusively to PipelineReportHandler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants