[ https://issues.apache.org/jira/browse/HDFS-16900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17684366#comment-17684366 ]
ZhangHB commented on HDFS-16900: -------------------------------- Hi, [~elgoiri] . After reading the codes here, I found the original codes is right. There is no need to change the isWrite logic here because when recovery progress occures, createBlockOutputStream will be invoked in setupPipelineInternal method. In createBlockOutputStream method, it has code below: {code:java} BlockConstructionStage bcs = recoveryFlag ? stage.getRecoveryStage() : stage; {code} then passes the bcs to writeBlock method. in writeBlock method, it will use dataXceiverServer.getWriteThrottler(). > Method DataNode#isWrite seems not working in DataTransfer constructor method > ---------------------------------------------------------------------------- > > Key: HDFS-16900 > URL: https://issues.apache.org/jira/browse/HDFS-16900 > Project: Hadoop HDFS > Issue Type: Bug > Components: datanode > Affects Versions: 3.3.4 > Reporter: ZhangHB > Priority: Major > > In constructor method of DataTransfer, there is codes below: > {code:java} > if (isTransfer(stage, clientname)) { > this.throttler = xserver.getTransferThrottler(); > } else if(isWrite(stage)) { > this.throttler = xserver.getWriteThrottler(); > } {code} > the stage is a parameter of DataTransfer Constructor. Let us see where > instantiate DataTransfer object. > In method transferReplicaForPipelineRecovery, codes like below: > {code:java} > final DataTransfer dataTransferTask = new DataTransfer(targets, > targetStorageTypes, targetStorageIds, b, stage, client); {code} > but the stage can never be PIPELINE_SETUP_STREAMING_RECOVERY or > PIPELINE_SETUP_APPEND_RECOVERY. > It can only be TRANSFER_RBW or TRANSFER_FINALIZED. So I think the method > isWrite is not working. -- 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