-
Notifications
You must be signed in to change notification settings - Fork 9.1k
HDFS-15423 RBF: WebHDFS create shouldn't choose DN from all sub-clusters #2605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
...-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterWebHdfsMethods.java
Outdated
Show resolved
Hide resolved
<
8000
/div>
...-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterWebHdfsMethods.java
Outdated
Show resolved
Hide resolved
.../src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterWebHdfsMethods.java
Outdated
Show resolved
Hide resolved
...-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterWebHdfsMethods.java
Outdated
Show resolved
Hide resolved
...-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterWebHdfsMethods.java
Outdated
Show resolved
Hide resolved
.../src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterWebHdfsMethods.java
Outdated
Show resolved
Hide resolved
...-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterWebHdfsMethods.java
Outdated
Show resolved
Hide resolved
💔 -1 overall
This message was automatically generated. |
Thanks for the review @goiri. I may need to fix some other unit tests. |
💔 -1 overall
This message was automatically generated. |
.../src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterWebHdfsMethods.java
Outdated
Show resolved
Hide resolved
.../src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterWebHdfsMethods.java
Outdated
Show resolved
Hide resolved
...-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterWebHdfsMethods.java
Outdated
Show resolved
Hide resolved
.../src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterWebHdfsMethods.java
Outdated
Show resolved
Hide resolved
.../src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterWebHdfsMethods.java
Outdated
Show resolved
Hide resolved
.../src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterWebHdfsMethods.java
Outdated
Show resolved
Hide resolved
@goiri Thanks for the further review. |
Adding flaky tests is not a good idea. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
Any chance we can fix the findbugs? |
Yeah, uploaded another small change for it. Hopefully it should cover everything. |
💔 -1 overall
This message was automatically generated. |
Thanks @fengnanli for the fix. |
🎊 +1 overall
This message was automatically generated. |
resolvedNs = rpcServer.getLocationsForPath(path, true) | ||
.get(0).getNameserviceId(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanx @fengnanli, Seems I have got little confused here -
This method will get call for (OPEN/APPEND/GETFILECHECKSUM) also, There is a check below as well for these operations.
So, Here we are taking the first nameservice as the resolvedNs, and datanodes from other namespace we add into excluded nodes. What I understood by this check below -
if (collection.contains(dn.getName()) || !ns.equals(resolvedNs)) { excludes.add(dn);
So, In case the file was in the other namespace, rather than being in the first one in case of say RANDOM or SPACE order, so will we not put those datanodes into the excluded ones? and apparently the call may fail for say APPEND or OPEN.
Am I missing some check here? if not, the resolvedNs for these cases we should get from the getFileInfo
?
Secondly, In case of create call, we are taking the datanodes from the first namespace, are we sure the create call was to the first Namespace only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review @ayushtkn
For 1, I agree that use getFileInfo
is more accurate so I add another filter to limit only CREATE will apply the resolvedNS.
For 2, the first one should be enough since it is the destination with the highest priority based on the destination order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually For 2, I found there is a getCreateLocation inside RouterRpcServer to get a unique create ns. I will use that to make create in parity between rpc and http.
🎊 +1 overall
This message was automatically generated. |
...-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterWebHdfsMethods.java
Outdated
Show resolved
Hide resolved
getTrimmedStringCollection(excludeDatanodes); | ||
for (DatanodeInfo dn : dns) { | ||
String ns = getNsFromDataNodeNetworkLocation(dn.getNetworkLocation()); | ||
if (collection.contains(dn.getName()) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This if starts getting complex, maybe we want to extract it and do multiple levels of ifs there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made it if () else if () so the logic is clearer. How do you think?
.../src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterWebHdfsMethods.java
Show resolved
Hide resolved
.../src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterWebHdfsMethods.java
Outdated
Show resolved
Hide resolved
🎊 +1 overall
This message was automatically generated. |
@goiri Addressed the comments as suggested. Can you give it another look? Thanks very much! |
💔 -1 overall
This message was automatically generated. |
27f21f9
to
e413f34
Compare
Rebase on latest trunk and force push. |
💔 -1 overall
This message was automatically generated. |
The test failures are related with the change in HADOOP-13327 and is under fix in HDFS-15836 |
.../src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterWebHdfsMethods.java
Show resolved
Hide resolved
...-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterWebHdfsMethods.java
Show resolved
Hide resolved
🎊 +1 overall
This message was automatically generated. |
@goiri Can we land this one? Thanks. |
If @ayushtkn doesn't have further comments, I'll go ahead and merge this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @goiri,
please proceed, changes looks good
…ub-clusters (apache#2605)" (apache#2900) This reverts commit cb3ed32.
NOTICE
Please create an issue in ASF JIRA before opening a pull request,
and you need to set the title of the pull request which starts with
the corresponding JIRA issue number. (e.g. HADOOP-XXXXX. Fix a typo in YYY.)
For more details, please see https://cwiki.apache.org/confluence/display/HADOOP/How+To+Contribute