fluss icon indicating copy to clipboard operation
fluss copied to clipboard

Improve TabletServer RPC scheduling under connection skew and bucket contention

Open platinumhamburg opened this issue 1 week ago • 0 comments

Motivation

This follows #4926. During a primary-key backfill, a few TabletServer RPC workers can build long queues while other workers sit idle. Unrelated lookups can wait behind slow writes assigned to the same worker. Two requests that touch the same bucket can also occupy separate workers while contending for the bucket.

Solution

  • Keep pending requests with their TCP connection. Schedule the first pending RPC from each connection as a whole, and allow at most one synchronous handler at a time per connection. Workers with no local ready request can take over an eligible connection within the same listener resource group.
  • Track the bucket access of registered KV RPC queue heads using a bitmap keyed by table and partition. Run compatible readers concurrently and preserve the position of an earlier registered writer on a shared bucket. Keep the existing synchronous handler, replication acknowledgements, and wire format.
  • Pipeline up to two pending requests per connection. Charge admitted wire frames against a shared byte budget per listener resource group. If the oldest waiting frame cannot fit, allow small frames to use a bounded share of the available bytes while preserving the oldest frame's ability to acquire the budget.
  • Use this path automatically on TabletServer listener groups that serve only native Fluss RPC. The CoordinatorServer and groups serving another protocol keep their worker queue watermarks.

Validation

Evaluate point and prefix lookup latency alongside write latency, SLO-constrained throughput, worker occupancy, TCP backpressure, and memory. Cover natural connection mapping, overlapping-bucket bursts and sustained skew, plus concurrent large writes and small point lookups. Review the implementation in #5285.

Willingness to contribute

  • [x] I'm willing to submit a PR!

platinumhamburg avatar Nov 19 '26 12:11 platinumhamburg