Skip to content

[CELEBORN-2250] Fix lock contention in ReducePartitionCommitHandler.finishMapperAttempt via fine-grained locks#3586

Closed
yew1eb wants to merge 2 commits intoapache:mainfrom
yew1eb:CELEBORN-2250
Closed

[CELEBORN-2250] Fix lock contention in ReducePartitionCommitHandler.finishMapperAttempt via fine-grained locks#3586
yew1eb wants to merge 2 commits intoapache:mainfrom
yew1eb:CELEBORN-2250

Conversation

@yew1eb
Copy link
Contributor

@yew1eb yew1eb commented Jan 19, 2026

What changes were proposed in this pull request?

Add shuffleIdLocks (fine-grained locks per shuffleId), replace global shuffleMapperAttempts lock in initMapperAttempts and finishMapperAttempt.

Why are the changes needed?

High concurrency causes lock contention on shuffleMapperAttempts in finishMapperAttempt, leading to abnormally long shuffle write time for small queries in Kyuubi Shared Mode. Fine-grained locks eliminate cross-shuffle blocking and improve concurrency.

Does this PR resolve a correctness bug?

No.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

CI.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request addresses lock contention issues in ReducePartitionCommitHandler.finishMapperAttempt by introducing fine-grained per-shuffle locks. The change replaces synchronization on the global shuffleMapperAttempts object with per-shuffle lock objects stored in a new shuffleIdLocks ConcurrentHashMap.

Changes:

  • Added shuffleIdLocks ConcurrentHashMap to store per-shuffle lock objects
  • Updated finishMapperAttempt to acquire per-shuffle locks instead of global lock
  • Updated initMapperAttempts to acquire per-shuffle locks instead of global lock

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…ndler.finishMapperAttempt via fine-grained locks
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SteNicholas SteNicholas requested a review from RexXiong January 27, 2026 12:27
Copy link
Contributor

@RexXiong RexXiong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. LGTM

@SteNicholas SteNicholas changed the title [CELEBORN #2250] Fix lock contention in ReducePartitionCommitHandler.finishMapperAttempt via fine-grained locks [CELEBORN-2250] Fix lock contention in ReducePartitionCommitHandler.finishMapperAttempt via fine-grained locks Jan 27, 2026
@SteNicholas
Copy link
Member

SteNicholas commented Jan 27, 2026

Thanks for contribution. Merged to main(v0.7.0).

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.

4 participants