Skip to content

[CELEBORN-2600] Fix worker congestion control never exiting on idle worker - #4005

Open
yew1eb wants to merge 1 commit into
apache:mainfrom
yew1eb:CELEBORN-2600
Open

yew1eb wants to merge 1 commit into
apache:mainfrom
yew1eb:CELEBORN-2600

Conversation

@yew1eb

@yew1eb yew1eb commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

CongestionController.getTotalPendingBytes() now returns the bytes actually produced but not yet flushed — diskBufferCounter (disk flusher backlog) + memoryFileStorageCounter (memory-staged shuffle data) + sortMemoryCounter (in-flight sort memory) — instead of MemoryManager.getMemoryUsage() (Netty usedDirectMemory + sort memory).

Why are the changes needed?

checkCongestion() exits congestion only when getTotalPendingBytes() < diskBufferLowWatermark && produceSpeed < produceSpeedLowWatermark. The old implementation derived pending bytes from Netty usedDirectMemory, which behaves as a high-water ratchet: pooled Netty chunks are retained after their buffers are freed, so after a load peak the metric plateaus near the peak even on a fully idle worker.

Observed on a 6-worker test cluster (v0.6.2, celeborn.worker.congestionControl.diskBuffer.high/low.watermark = 2600MB/2000MB): once a worker crossed the high watermark during peak shuffle load, WorkerCongested, IsHighWorkload (worker side) and ExcludedWorkerCount (master side) never recovered after all jobs finished. The exit condition was never satisfied, overHighWatermark stayed true forever, and the worker kept reporting highWorkload=true in every heartbeat, leaving it permanently in the master's excludedWorkers (CELEBORN-1782 chain). Only restarting the worker process cleared the exclusion.

Idle-worker evidence (MemoryManager periodic report — all real pending counters at zero while direct memory is still above the low watermark):

26/11/23 15:45:44,864 INFO [worker-memory-manager-reporter] MemoryManager:
Direct memory usage: 2.4 GiB/100.0 GiB, disk buffer size: 0.0 B, sort memory size: 0.0 B, read buffer size: 0.0 B, memory file storage size : 0.0 B
image image

Does this PR resolve a correctness bug?

  • Yes

Does this PR introduce any user-facing change?

  • Yes

How was this patch tested?

  • New unit tests in TestCongestionController (all pre-existing tests override getTotalPendingBytes(), so the real implementation was previously untested):
    • testTotalPendingBytesTracksUnflushedBuffers: pending bytes count the flusher backlog, memory-staged data and sort memory, and return to baseline once released — independent of retained Netty direct memory.
    • testCongestionExitsAfterAllBuffersReleased: after pending bytes cross the high watermark, congestion exits once the buffers are flushed.

@github-actions github-actions Bot added correctness Correctness bugfix module:worker and removed correctness Correctness bugfix labels Nov 23, 2026
…orker

getTotalPendingBytes() derived pending bytes from MemoryManager.getMemoryUsage()
(Netty usedDirectMemory + sort memory). Pooled Netty chunks are retained after
their buffers are freed, so direct memory behaves as a high-water ratchet: once
a load peak pushed it above the low watermark it stayed there even on a fully
idle worker. checkCongestion()'s exit condition was therefore never satisfied,
overHighWatermark stayed true forever, and the worker kept reporting
highWorkload=true in heartbeats, leaving it permanently excluded by the master
(CELEBORN-1782 chain).

Track instead the bytes actually produced but not yet flushed - the disk
flusher backlog (diskBufferCounter), memory-staged shuffle data
(memoryFileStorageCounter) and in-flight sort memory (sortMemoryCounter) - all
of which decay to zero on an idle worker and match the documented semantics of
the diskBuffer watermarks.
@yew1eb

yew1eb commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

cc @SteNicholas @zaynt4606

This branch has not been deployed

No deployments
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