You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "Xiaoqiao He (Jira)" <ji...@apache.org> on 2026/07/14 04:44:00 UTC
[jira] [Resolved] (HDFS-17931) Add early return in PendingDataNodeMessages.removeQueuedBlock when queue is empty
[ 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: hdfs-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-help@hadoop.apache.org