HDFS-17312. packetsReceived metric should ignore heartbeat packet. (#6394)

Signed-off-by: Takanobu Asanuma <tasanuma@apache.org>
This commit is contained in:
hfutatzhanghb 2024-01-11 21:08:37 +08:00 committed by GitHub
parent 55b9f87698
commit 6a053765ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,6 +38,7 @@
import org.apache.hadoop.fs.ChecksumException;
import org.apache.hadoop.fs.FSOutputSummer;
import org.apache.hadoop.fs.StorageType;
import org.apache.hadoop.hdfs.DFSPacket;
import org.apache.hadoop.hdfs.DFSUtilClient;
import org.apache.hadoop.hdfs.protocol.DatanodeInfo;
import org.apache.hadoop.hdfs.protocol.ExtendedBlock;
@ -598,7 +599,9 @@ private int receivePacket() throws IOException {
return 0;
}
datanode.metrics.incrPacketsReceived();
if (seqno != DFSPacket.HEART_BEAT_SEQNO) {
datanode.metrics.incrPacketsReceived();
}
//First write the packet to the mirror:
if (mirrorOut != null && !mirrorError) {
try {