This is an automated email from the ASF dual-hosted git repository.

zhangshuyan pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new a30681077b8c HDFS-17291. DataNode metric bytesWritten is not totally 
accurate in some situations. (#6360). Contributed by farmmamba.
a30681077b8c is described below

commit a30681077b8c924954b6c46755370d110aeeda12
Author: hfutatzhanghb <hfutzhan...@163.com>
AuthorDate: Sat Jan 13 20:45:00 2024 +0800

    HDFS-17291. DataNode metric bytesWritten is not totally accurate in some 
situations. (#6360). Contributed by farmmamba.
    
    Reviewed-by: huangzhaobo <huangzhaob...@126.com>
    Signed-off-by:  Shuyan Zhang <zhangshu...@apache.org>
---
 .../main/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java
index 86ee6bd431ef..38b03f8d6a24 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockReceiver.java
@@ -842,7 +842,7 @@ class BlockReceiver implements Closeable {
           
           replicaInfo.setLastChecksumAndDataLen(offsetInBlock, lastCrc);
 
-          datanode.metrics.incrBytesWritten(len);
+          datanode.metrics.incrBytesWritten(numBytesToDisk);
           datanode.metrics.incrTotalWriteTime(duration);
 
           manageWriterOsCache(offsetInBlock, seqno);


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

Reply via email to