-
Notifications
You must be signed in to change notification settings - Fork 9.1k
HDFS-16368. DFSadmin supports refresh topology info without restarting namenode #3743
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
base: trunk
Are you sure you want to change the base?
HDFS-16368. DFSadmin supports refresh topology info without restarting namenode #3743
Conversation
💔 -1 overall
This message was automatically generated. |
e129bac
to
12b3c37
Compare
💔 -1 overall
This message was automatically generated. |
12b3c37
to
5f5375e
Compare
💔 -1 overall
This message was automatically generated. |
@ayushtkn @goiri @Hexiaoqiao @tomscut , sorry for disturbing you. could we push this PR forward? any suggestions? |
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.
just passing by dropped some comments, have to go in detail. btw. does this update topology for all namenodes or just active, couldn't figure out in my quick pass, make sure all namenodes get updated and there ain't any surprises post failovers
@Override | ||
public void refreshTopology() throws IOException { | ||
// Router not support this operation, because this maybe refresh multi namespaces | ||
String methodName = RouterRpcServer.getMethodName(); | ||
throw new UnsupportedOperationException( | ||
"Operation \"" + methodName + "\" is not supported"); | ||
} | ||
|
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.
in case of router it should delegate the request to all namespaces, that is how all other commands of similar nature work
* refresh the network topology of this cluster based on the mapping_topology.data file. | ||
*/ | ||
public void refreshTopology() throws IOException { | ||
long start = System.currentTimeMillis(); |
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.
use Time.monotonicNow for duration calculations
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.
Sir, have fixed.
6e283f2
to
3f576ca
Compare
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
Not sure why this PR has been pick up again. IIRC we have discussed add tools to support refresh topology online many times. I would like to share my concern again. This is one high-risky operation, especially for one large cluster. Considering the case that change the cluster topology randomly then namenode failover or restart, there will be block transfer flood where the replications of one block should be going to have enough racks. Before all blocks have enough racks (which is cost long times) the cluster could enter high-load phase and couldn't process any requests from client. In one word, be careful to refresh topology online if there is no stability guarantee measures. |
@Hexiaoqiao Sir, thanks for your reminding. I got your concern here. I think this PR just provide a tool which can refresh topology without restarting namenode. As for how to use this tool safely to prevent causing transfer flood belongs to end-user. They can modify a small part of topologay_mappings.data every time, then refreshTopology and wait for transfering completed. Do this procedure until all parts of topologay_mappings.data updated finally. |
Description of PR
Currently in HDFS, if we update the rack info for rack-awareness, we may need to rolling restart namenodes to let it be effective. If cluster is large, the cost time of rolling restart namenodes is very log. So, we develope a method to refresh topology info without rolling restart namenodes.
How was this patch tested?
fsck
to check its block location and rack info.For code changes:
https://issues.apache.org/jira/browse/HDFS-16368