[
https://issues.apache.org/jira/browse/HDFS-17931?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Xiaoqiao He resolved HDFS-17931.
--------------------------------
Fix Version/s: 3.6.0
Hadoop Flags: Reviewed
Resolution: Fixed
> 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
> Priority: Major
> Labels: pull-request-available
> Fix For: 3.6.0
>
>
> 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]