[ 
https://issues.apache.org/jira/browse/HDFS-17383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17820952#comment-17820952
 ] 

ASF GitHub Bot commented on HDFS-17383:
---------------------------------------

ThinkerLei commented on code in PR #6562:
URL: https://github.com/apache/hadoop/pull/6562#discussion_r1503615979


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeManager.java:
##########
@@ -2043,10 +2043,13 @@ public void setBalancerBandwidth(long bandwidth) throws 
IOException {
     }
   }
   
-  public void markAllDatanodesStale() {
+  public void markAllDatanodesStaleAndSetNeedKeyUpdate() {
     LOG.info("Marking all datanodes as stale");
     synchronized (this) {
       for (DatanodeDescriptor dn : datanodeMap.values()) {
+        if (blockManager.isBlockTokenEnabled()) {
+          dn.setNeedKeyUpdate(true);

Review Comment:
   To ensure datanode current block token is  come from active namenode.





> Datanode current block token should come from active NameNode in HA mode
> ------------------------------------------------------------------------
>
>                 Key: HDFS-17383
>                 URL: https://issues.apache.org/jira/browse/HDFS-17383
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: lei w
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: reproduce.diff
>
>
> We found that transfer block failed during the namenode upgrade. 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 newly upgraded NN has just been started, the keyid owned by the 
> source datanode may not be owned by the target datanode, so the write fails. 
> Here's how to reproduce this situation in the attachment



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to