Visitar URL original
feat(amber): rank receivers by backlog and steer least-loaded senders by jrt1899 · Pull Request #8863 · apache/texera · GitHub
Skip to content

feat(amber): rank receivers by backlog and steer least-loaded senders - #8863

Open
jrt1899 wants to merge 2 commits into
apache:mainfrom
jrt1899:feat/least-loaded-routing-coordinator
Open

jrt1899 wants to merge 2 commits into
apache:mainfrom
jrt1899:feat/least-loaded-routing-coordinator

Conversation

@jrt1899

@jrt1899 jrt1899 commented Oct 5, 2026

Copy link
Copy Markdown

What changes were proposed in this PR?

The second of three PRs. Still inert: no link uses the least-loaded partitioner until PR 3, and the flag defaults to off.

Stacked on #8862. Until that merges, this PR also shows its commit. Only the last commit, 55f451f, is new here.

  • LeastLoadedRoutingService: on each statistics poll the coordinator ranks a link's receivers by backlog (received − processed) and gives each sender one, spreading senders across receivers rather than sending them all to the single least-loaded one.
  • UpdateRoutingPreference RPC (Scala and Python workers): tells each sender which receiver to fill next. It only moves an index on the existing partitioner. It is kept separate from AddPartitioning, which rebuilds the partitioner and would throw away a partly filled batch on every poll.
  • Config flags: network-buffering.enable-least-loaded-routing (default false) and least-loaded-routing-verbose.
flowchart LR
  W["UDF2 workers<br/>received, processed"] -->|"stats poll (~500 ms)"| C["Coordinator<br/>rank by backlog"]
  C -->|"UpdateRoutingPreference(link, idx)"| S["UDF1 senders"]
  S -->|"next full batch"| W
Loading

Any related issues, documentation, discussions?

Part of: #8858
Depends on: #8862

How was this PR tested?

  • sbt "testOnly *LeastLoadedRoutingServiceSpec": the least-backlogged receiver goes to the first sender, senders with equal counts get different receivers, a receiver with no reading counts as idle, an empty link yields no assignments, and every sender is assigned when senders outnumber receivers.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Sonnet 5.5, Claude Opus 5.5)

🤖 Generated with Claude Code

jrt1899 and others added 2 commits October 5, 2026 08:51
Add a LeastLoadedPartitioning/LeastLoadedPartitioner pair for links whose
partitioning is unconstrained. Instead of dealing tuples across one buffer
per receiver (round robin), a sender fills a single batch at a time and
sends it to one preferred receiver, so the first batch ships after
batchSize tuples rather than senders x receivers x batchSize.

Workers also report received_tuple_count, counted when a batch arrives.
Received minus processed is a receiver's queued backlog, which later
changes use to choose the preferred receiver.

Nothing selects the new partitioner yet and RoundRobinPartitioner is
untouched, so behaviour is unchanged.

Part of apache#8519

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
On each statistics poll the coordinator ranks a least-loaded link's
receivers by backlog (received minus processed tuples) and tells every
sender which receiver to fill next through a new UpdateRoutingPreference
RPC. The RPC only moves an index on the existing partitioner. It is kept
separate from AddPartitioning, which rebuilds the partitioner and would
discard a partly filled batch on every poll.

Adds the enable-least-loaded-routing flag (default false) and a verbose
logging flag. No link uses the least-loaded partitioner yet, so behaviour
is unchanged.

Part of apache#8519

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @aglinxinyuan, @Yicong-Huang, @shengquan-ni
    You can notify them by mentioning @aglinxinyuan, @Yicong-Huang, @shengquan-ni in a comment.

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