Skip to content

feat: Add round robin bucket assigner#360

Merged
luoyuxia merged 5 commits intoapache:mainfrom
charlesdong1991:add-round-robin-assigner
Feb 25, 2026
Merged

feat: Add round robin bucket assigner#360
luoyuxia merged 5 commits intoapache:mainfrom
charlesdong1991:add-round-robin-assigner

Conversation

@charlesdong1991
Copy link
Contributor

Purpose

Linked issue: close #322

Brief change log

Create RoundRobinBucketAssigner and update create_bucket_assigner to make this config configurable with default of sticky

Tests

  • add test of round_robin_assigner_cycles_through_buckets
  • add test of round_robin_assigner_does_not_abort_on_batch_full

Copy link
Contributor

@leekeiabstraction leekeiabstraction left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! Left some comments.

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

Adds a configurable bucket assignment strategy for tables without bucket keys, introducing a new round-robin assigner and wiring it through writer configuration to complement the existing sticky behavior.

Changes:

  • Add RoundRobinBucketAssigner implementation and unit tests for its cycling behavior.
  • Add writer_bucket_no_key_assigner config option (defaulting to sticky).
  • Update WriterClient::create_bucket_assigner to select sticky vs round-robin based on config.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
crates/fluss/src/config.rs Introduces a new CLI/serde config field to select the no-key bucket assigner strategy.
crates/fluss/src/client/write/writer_client.rs Wires the config into bucket assigner creation for no-key tables and errors on unknown values.
crates/fluss/src/client/write/bucket_assigner.rs Implements RoundRobinBucketAssigner and adds unit tests for cycling + batch-full behavior flag.

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

Copy link
Contributor

@leekeiabstraction leekeiabstraction left a comment

Choose a reason for hiding this comment

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

Thank you for the update! Much appreciated. Left additional comments

Copy link
Contributor

@leekeiabstraction leekeiabstraction left a comment

Choose a reason for hiding this comment

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

Thank you for the revision! Just one more question left.

Copy link
Contributor

@leekeiabstraction leekeiabstraction left a comment

Choose a reason for hiding this comment

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

Approved. Thank you for the PR!

Copy link
Contributor

@luoyuxia luoyuxia left a comment

Choose a reason for hiding this comment

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

@charlesdong1991 Thanks. LGTM!

@luoyuxia luoyuxia merged commit 094ff3e into apache:main Feb 25, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add RoundRobinBucketAssignor

4 participants