HDDS-6648. Fix the inconsistency between network-topology-default.xml and network-topology-default.yaml#3350
Conversation
|
@adoroszlai @ChenSammi Could you help to review the PR? |
|
@symious , the default "network-topology-default.xml" file, the total level is 3, that is / (root), rack, node. Another topology file "network-topology-nodegroup.xml" , total level is 4, including a new nodegroup level. Could you further explain the problem a bit more? I don't quite understand the issue. |
|
@ChenSammi Thanks for the review. The problem I think is the content of the topology, in I think it's better to remove the trick operation to reduce any possible misunderstandings. |
In network-topology-default.xml, "datacenter" is just the name ID of the root layer in this topology configuration file. Please don't treat the "/" in topology configuration file the same as "/" in code. |
|
Thanks for the reply. @ChenSammi But the misunderstanding still exists, especially when users want to add a real level named datacenter. It might look like "/datacenter/datacenter/rack/node" |
If user wants to add a new level, he/she should create a new topology file, using the name preferred, or change the level ID to whatever he/she wants. "datacenter" is just a name, it can be changed. |
|
Indeed, the name can be changed, but this change is evitable. In fact, I don't have any questions on the topology content of "network-topology-default.xml", I have took some time checking the code to realize that the node schema file is of different means with the action topology in code. But the confusion still exists as follows:
And I think these confusions should come to most of the users trying to work with the topology, although these are not hard to find the answers, they still need to spend some time to solve these confusions before they can work on. |
This inconsistency is an issue. It should be fixed.
It should not cause any issue. |
If the name can be changed, how about change the current "datacenter" to "root"? |
Basically, I don't suggest to change the name "datacenter" in default topology. We defined node "type" in the configuration. There are Root, Inner_Node, and Leaf type. This type matters, while layer id doesn't. Also in a Hadoop typical cluster(HDFS), user will usually think the the default root is datacenter. This user experience is consistent. |
|
@symious , as we have a consensus on the inconsistency between network-topology-default.xml and network-topology-default.yaml should be fixed, would you like to refactor this patch so that we can have it fixed and merged? |
|
@ChenSammi Sure, update the PR, please have a look. |
| - | ||
| cost: 1 | ||
| prefix: ng | ||
| defaultName: nodegroup |
There was a problem hiding this comment.
There is no nodegroup in default topology. We can remove this layer.
Could you add a unit test in TestYamlSchemaLoader.java? load this default topology configuration file, and check there is 3 level NodeSchema in NodeSchemaManager?
There was a problem hiding this comment.
@ChenSammi Thanks for the review. Updated the PR, please have a check.
|
LGTM +1. Thanks @symious for the contribution. |
|
@ChenSammi Thanks for the review and merge. |
What changes were proposed in this pull request?
In
NodeSchemaLoader.init(), the file of "network-topology-default.xml" is loaded to retrieve the topology schema.By default the result schema is "/datacenter/rack/node", and the schema size is 3, since datacenter is treated as "ROOT".
The schema size will also be sent to NetworkTopologyImpl to build the topology, the schema size is used as maxLevel.
But for "/datacenter/rack/node" the maxLevel is in fact 4, the reason of the issue is that "datacenter" is treated as "ROOT" incorrectly. While the yaml file version is correctly treated "datacenter" to a InnerNode.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-6648
How was this patch tested?
unit test.