-
Notifications
You must be signed in to change notification settings - Fork 9k
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
HDFS-17383:Datanode current block token should come from active NameNode in HA mode #6562
Conversation
LOG.info("Marking all datanodes as stale"); | ||
synchronized (this) { | ||
for (DatanodeDescriptor dn : datanodeMap.values()) { | ||
if (blockManager.isBlockTokenEnabled()) { | ||
dn.setNeedKeyUpdate(true); |
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.
Why do you setNeedKeyUpdate
here?
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.
To ensure datanode current block token is come from active namenode.
💔 -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. |
There is a problem with this fix. Assuming the following situation:
|
80f5d49
to
6b1ed1a
Compare
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
@zhangshuyan0 Thank you very much for your comment. The case you mentioned has been fixed. When there is no active namenode, the currentKey will be set to one of the standby nodes. When a failover occurs, the active namenode will proactively trigger the distribution of the key to the DataNode to promptly modify the currentKey. |
🎊 +1 overall
This message was automatically generated. |
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.
+1. LGTM.
…ode in HA mode (apache#6562). Contributed by lei w. Reviewed-by: Shuyan Zhang <[email protected]> Signed-off-by: Shuyan Zhang <[email protected]>
We found that transfer block failed during the standby namenode restart. The specific error reported was that the block token verification failed. The reason is that during the datanode transfer block process, the source datanode uses its own generated block token, and the keyid comes from ANN or SBN. However, because the SBN has just been restarted, the keyid owned by the source datanode may not be owned by the target datanode, so write fails. Here's how to reproduce this situation in HDFS-17383