apache / apache/fluss-rust

Rust client should support comma-separated bootstrap servers

Open
#585 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
58
Forks
50
PR merge metrics
No merged PRs in 30d

Description

### Search before asking

- [x] I searched in the [issues](https://github.com/apache/fluss-rust/issues) and found nothing similar.

### Please describe the bug 🐞

The Rust client currently appears to support only one bootstrap endpoint, even though the public configuration is named `bootstrap_servers` / `bootstrap.servers`. A comma-separated value such as `127.0.0.1:9123,127.0.0.1:9124` should be accepted so users can configure multiple bootstrap nodes for high availability.

Current behavior:

1. Set the Rust client config to a comma-separated bootstrap list, for example:

```rust
let mut config = Config::default();
config.bootstrap_servers = "127.0.0.1:9123,127.0.0.1:9124".to_string();
let conn = FlussConnection::create(config).await?;
```

2. The client passes the whole string through `Metadata::new` / `Metadata::init_cluster`.
3. `Metadata::parse_bootstrap` calls `to_socket_addrs()` on the complete string, so the comma-separated value is treated as a single socket address and fails to resolve.

Expected behavior:

The client should parse `bootstrap_servers` as a comma-separated list of `host:port` entries, trim whitespace, validate each endpoint, and use one reachable bootstrap endpoint to initialize metadata. Reinitialization should also keep using the configured bootstrap list instead of assuming a single address.

Impact:

Users cannot configure multiple bootstrap nodes/coordinators for HA or failover. This also makes the plural config name misleading.

### Solution

Update the client bootstrap parsing to return a list of socket addresses rather than a single `SocketAddr`. During metadata initialization and reinitialization, try the parsed endpoints in a deterministic order, falling back to the next endpoint if one cannot be resolved or connected.

Suggested test coverage:

- comma-separated IPv4/hostname entries, e.g. `127.0.0.1:9123,localhost:9124`;
- whitespace around entries;
- IPv6 entries such as `[::1]:9123`;
- invalid empty entries and invalid ports;
- `reinit_cluster` uses the configured bootstrap list.

### Are you willing to submit a PR?

- [ ] I'm willing to submit a PR!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.