Janus Chow created HDFS-17931:
---------------------------------

             Summary: Add early return in 
PendingDataNodeMessages.removeQueuedBlock when queue is empty
                 Key: HDFS-17931
                 URL: https://issues.apache.org/jira/browse/HDFS-17931
             Project: Hadoop HDFS
          Issue Type: Improvement
            Reporter: Janus Chow
            Assignee: Janus Chow


removeQueuedBlock() is called for every block in a block report. When the 
pending queue is empty (count == 0), the method still unconditionally allocates 
a new Block() and does a HashMap.get() before returning null. On large 
DataNodes this is millions of unnecessary allocations per report.

 

This is especially costly under ZGC, where these operations trigger load/write 
barriers even on the no-op path. In practice, on a ZGC Observer NameNode, count 
is almost always 0 because ZGC's sub-millisecond pauses keep EditLogTailer 
current, so isGenStampInFuture() rarely triggers.

Fix: add a count == 0 early return before the new Block() allocation.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to