HDFS-17896. Move logAllocatedBlock out of lock to reduce latency#8360
HDFS-17896. Move logAllocatedBlock out of lock to reduce latency#8360ayushtkn merged 1 commit intoapache:trunkfrom
Conversation
|
💔 -1 overall
This message was automatically generated. |
42c5193 to
7c07491
Compare
|
💔 -1 overall
This message was automatically generated. |
7a9cb73 to
60e1c6c
Compare
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
Failed UTs are not relevant to this pr. |
|
yeah, added in description |
| writeUnlock(RwLockMode.GLOBAL, operationName); | ||
| } | ||
| getEditLog().logSync(); | ||
| if (blockInfo != null) { |
There was a problem hiding this comment.
when will be blockInfo null? I don't see any null check earlier
There was a problem hiding this comment.
When add new chosen targets to already allocated block or retry, blockInfo is null.
|
@CapMoon I am gonna hit the merge button, can you help me confirm your jira id or assign the ticket to your name. is it : So, you have due credits in the Jira, in case you don't have a jira id or access to the assign, let me know, I will sort it out for you |
@ayushtkn This is my first time to contribute to community, so i don't have a jira id or access to the assign, plz help me to get them, thx :) |
|
@CapMoon Just fill this for with project as Hadoop, can mention this PR in the description & let me know once you are done with it I will approve & get you the required permissions to assign the ticket |
|
@ayushtkn Thx master, I have finished submitting the request on https://selfserve.apache.org/jira-account.html |
|
@CapMoon I don't see any request submitted. Can you double check if you selected Hadoop as the project and actually clicked submit & it did succeed |
|
@ayushtkn I did submit the request, when submit again, it remind me there already has a pending request with email: wangyue19997053@gmail.com
|
|
@CapMoon Did you verify your email after that. I checked with folks from Infra, They say unless you verify your email, we won't get the request to approve |
|
@ayushtkn Already verified my email, thx for your notice |
|
@ayushtkn Hi master, what is the update? |
|
I have merged it, for your JIRA id reach out private@infra.apache.org with the details, once you have the jira id, let me know I will assign the ticket |
|
@ayushtkn Hi master, my jira id is: buddhistvvy |
|
I have added you as HDFS Contributor & assigned the ticket. Welcome to Hadoop!!! |

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.
Performance improvement:
