Skip to content

[client] Allow bootstrap endpoint with unknown server type#622

Open
fxbing wants to merge 4 commits into
apache:mainfrom
fxbing:feature/20260615-unknown-bootstrap-server-type
Open

[client] Allow bootstrap endpoint with unknown server type#622
fxbing wants to merge 4 commits into
apache:mainfrom
fxbing:feature/20260615-unknown-bootstrap-server-type

Conversation

@fxbing

@fxbing fxbing commented Jun 15, 2026

Copy link
Copy Markdown

Purpose

Linked issue: close #621

Allow the Rust client to bootstrap from either coordinator or tablet server endpoints after server type validation is enabled.

Brief change log

  • Add ServerType::Unknown for bootstrap seed nodes.
  • Use ServerType::Unknown when creating the initial bootstrap ServerNode.
  • Skip server type validation only when the expected type is Unknown.
  • Add unit coverage for unknown expected server type.
  • Update Elixir binding server type mapping for the new variant.

Tests

  • cargo fmt --all -- --check
  • PROTOC=/opt/homebrew/bin/protoc cargo test -p fluss-rs --lib server_type_validation
  • PROTOC=/opt/homebrew/bin/protoc cargo test -p fluss-rs --lib
  • PROTOC=/opt/homebrew/bin/protoc cargo clippy --all-targets --workspace -- -D warnings

API and Format

This adds a public ServerType::Unknown enum variant. It does not change the wire protocol or storage format.

Documentation

No user-facing documentation change.

@leekeiabstraction leekeiabstraction left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for your first contribution and improving the client! Left a question.

)
.is_ok()
);
assert!(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should a simple integration test case be made in existing IT testing with unknown type/bootstrapping against tablet server?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Added an integration test covering bootstrapping from a tablet server endpoint. The test uses the shared cluster's tablet plaintext listener as bootstrap_servers, creates a FlussConnection, and verifies server node discovery returns both coordinator and tablet nodes.

@fxbing fxbing requested a review from leekeiabstraction June 16, 2026 11:20

@charlesdong1991 charlesdong1991 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

very nice PR! 👍

small tiny comments!

pub enum ServerType {
TabletServer,
CoordinatorServer,
Unknown,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i think we should update api-reference for this too

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Updated the Rust API reference to include ServerType::Unknown and documented that it is used when the client has not yet determined the endpoint type, such as bootstrap endpoints.

Comment thread crates/fluss/src/cluster/mod.rs Outdated
match type_id {
1 => Some(ServerType::CoordinatorServer),
2 => Some(ServerType::TabletServer),
-1 => Some(ServerType::Unknown),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

for any unrecognized id, should we return None or Unknown?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Aligned this with the Java client behavior. from_type_id now returns ServerType::Unknown for any unrecognized type id instead of None, matching Java's ServerType.fromTypeId. The validation path still fails when the client expects a concrete server type and the server advertises Unknown.

@fxbing fxbing requested a review from charlesdong1991 June 17, 2026 03:04
| `fn server_type(&self) -> &ServerType` | Server type (`CoordinatorServer`, `TabletServer`, or `Unknown`) |
| `fn uid(&self) -> &str` | Unique identifier (e.g. `"cs-0"`, `"ts-1"`) |

`ServerType::Unknown` is used when the client has not yet determined the endpoint

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i think other bindings' api reference also have it, but maybe i am wrong

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.

[client] Bootstrap should not require a coordinator server endpoint

3 participants