Skip to content

HDFS-17896. Move logAllocatedBlock out of lock to reduce latency#8360

Open
CapMoon wants to merge 1 commit intoapache:trunkfrom
CapMoon:HDFS-17896
Open

HDFS-17896. Move logAllocatedBlock out of lock to reduce latency#8360
CapMoon wants to merge 1 commit intoapache:trunkfrom
CapMoon:HDFS-17896

Conversation

@CapMoon
Copy link

@CapMoon CapMoon commented Mar 20, 2026

HDFS-17896. Move logAllocatedBlock out of lock in FSNamesystem.getAdditionalBlock to reduce latency

Description of PR

The logAllocatedBlock method in FSNamesystem.getAdditionalBlock is currently called while holding global lock. Flame graph analysis shows this logging path (via SLF4J/Log4j appenders) contributes non-trivial latency, blocking other NameNode operations.

Since logAllocatedBlock is only for audit/diagnostic logging and does not modify shared state, we can safely move it after releasing global lock to reduce lock hold time and improve write throughput.

This change preserves all existing logging behavior while eliminating unnecessary lock contention from I/O-bound logging operations.

How was this patch tested?

N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant