Skip to content

Rust client should support comma-separated bootstrap servers #585

Description

@luoyuxia

Search before asking

  • I searched in the 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:
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?;
  1. The client passes the whole string through Metadata::new / Metadata::init_cluster.
  2. 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions