This is an automated email from the ASF dual-hosted git repository. numinnex pushed a commit to branch fix_late_reply in repository https://gitbox.apache.org/repos/asf/iggy.git
commit 48256666ea050aad52a80fb5ac4e119af5c968cf Author: Grzegorz Koszyk <[email protected]> AuthorDate: Thu Aug 27 11:15:38 2026 +0200 remove failover_address --- .../configuration/tcp_config/tcp_client_config.rs | 11 ------- .../tcp_config/tcp_client_config_builder.rs | 38 ---------------------- core/sdk/src/client_provider.rs | 3 -- foreign/node/src/client/client.socket.ts | 7 ---- 4 files changed, 59 deletions(-) diff --git a/core/common/src/types/configuration/tcp_config/tcp_client_config.rs b/core/common/src/types/configuration/tcp_config/tcp_client_config.rs index 44480c337..b60f4b3ad 100644 --- a/core/common/src/types/configuration/tcp_config/tcp_client_config.rs +++ b/core/common/src/types/configuration/tcp_config/tcp_client_config.rs @@ -26,12 +26,6 @@ use std::str::FromStr; pub struct TcpClientConfig { /// The address of the Iggy server. pub server_address: String, - /// Addresses of other nodes of the same cluster, dialed in order when - /// `server_address` cannot be reached. The roster the server reports is - /// remembered while the client is connected and dialed first, so these - /// seeds only have to be enough to reach the cluster once -- at the very - /// first connect, when nothing has been learned yet. - pub failover_addresses: Vec<String>, /// Whether to use TLS when connecting to the server. pub tls_enabled: bool, /// The domain to use for TLS when connecting to the server. @@ -55,7 +49,6 @@ impl Default for TcpClientConfig { fn default() -> TcpClientConfig { TcpClientConfig { server_address: "127.0.0.1:8090".to_string(), - failover_addresses: Vec::new(), tls_enabled: false, tls_domain: "".to_string(), tls_ca_file: None, @@ -72,10 +65,6 @@ impl From<ConnectionString<TcpConnectionStringOptions>> for TcpClientConfig { fn from(connection_string: ConnectionString<TcpConnectionStringOptions>) -> Self { TcpClientConfig { server_address: connection_string.server_address().into(), - // The connection-string grammar names a single host, so a client - // built from one starts with no seeds and learns the roster once - // it is connected. - failover_addresses: Vec::new(), auto_login: connection_string.auto_login().to_owned(), tls_enabled: connection_string.options().tls_enabled(), tls_domain: connection_string.options().tls_domain().into(), diff --git a/core/common/src/types/configuration/tcp_config/tcp_client_config_builder.rs b/core/common/src/types/configuration/tcp_config/tcp_client_config_builder.rs index 08e50a9b6..943b69f53 100644 --- a/core/common/src/types/configuration/tcp_config/tcp_client_config_builder.rs +++ b/core/common/src/types/configuration/tcp_config/tcp_client_config_builder.rs @@ -23,7 +23,6 @@ use crate::{ /// Builder for the TCP client configuration. /// Allows configuring the TCP client with custom settings or using defaults: /// - `server_address`: Default is "127.0.0.1:8090" -/// - `failover_addresses`: Default is empty. /// - `auto_login`: Default is AutoLogin::Disabled. /// - `reconnection`: Default is enabled unlimited retries and 1 second interval. /// - `tls_enabled`: Default is false. @@ -45,13 +44,6 @@ impl TcpClientConfigBuilder { self } - /// Sets the addresses of other nodes of the same cluster, dialed in order - /// when `server_address` cannot be reached. - pub fn with_failover_addresses(mut self, failover_addresses: Vec<String>) -> Self { - self.config.failover_addresses = failover_addresses; - self - } - /// Sets the auto sign in during connection. pub fn with_auto_sign_in(mut self, auto_sign_in: AutoLogin) -> Self { self.config.auto_login = auto_sign_in; @@ -116,10 +108,6 @@ impl TcpClientConfigBuilder { pub fn build(mut self) -> Result<TcpClientConfig, IggyError> { self.config.server_address = self.config.server_address.trim().to_owned(); validate_server_address(&self.config.server_address)?; - for failover_address in &mut self.config.failover_addresses { - *failover_address = failover_address.trim().to_owned(); - validate_server_address(failover_address)?; - } Ok(self.config) } @@ -197,32 +185,6 @@ mod tests { )); } - #[test] - fn valid_failover_addresses_should_succeed() { - let config = builder_with_address("127.0.0.1:8090") - .with_failover_addresses(vec![ - " 127.0.0.1:8091 ".to_string(), - "iggy-server-3:8090".to_string(), - ]) - .build() - .expect("build the configuration"); - - assert_eq!( - config.failover_addresses, - vec!["127.0.0.1:8091", "iggy-server-3:8090"] - ); - } - - #[test] - fn malformed_failover_address_should_fail() { - let builder = builder_with_address("127.0.0.1:8090") - .with_failover_addresses(vec!["127.0.0.1".to_string()]); - assert!(matches!( - builder.build(), - Err(IggyError::InvalidIpAddress(_, _)) - )); - } - #[test] fn docker_compose_service_name_should_succeed() { let builder = builder_with_address("iggy-server:8090"); diff --git a/core/sdk/src/client_provider.rs b/core/sdk/src/client_provider.rs index 82d6d8204..6b431562a 100644 --- a/core/sdk/src/client_provider.rs +++ b/core/sdk/src/client_provider.rs @@ -135,9 +135,6 @@ impl ClientProviderConfig { TransportProtocol::Tcp => { config.tcp = Some(Arc::new(TcpClientConfig { server_address: args.tcp_server_address, - // Command-line arguments name a single server; the roster - // is learned once the client is connected. - failover_addresses: Vec::new(), tls_enabled: args.tcp_tls_enabled, tls_domain: args.tcp_tls_domain, tls_ca_file: args.tcp_tls_ca_file, diff --git a/foreign/node/src/client/client.socket.ts b/foreign/node/src/client/client.socket.ts index a69d78026..3924ba14a 100644 --- a/foreign/node/src/client/client.socket.ts +++ b/foreign/node/src/client/client.socket.ts @@ -772,13 +772,6 @@ export class CommandResponseStream extends EventEmitter { // read, leaderless ones included: a roster with no leader still names // where the nodes are. const metadata = GET_CLUSTER_METADATA.deserialize(response); - // Every read feeds the redial candidates, leaderless ones included: a - // roster with no leader still names where the nodes are. - this.connection.rememberRoster( - metadata.nodes - .filter((node) => node.endpoints.tcp !== 0) - .map((node) => ({ host: node.ip, port: node.endpoints.tcp })) - ); if (metadata.nodes.length <= 1) return undefined; const leader = metadata.nodes.find(
