chengxilo commented on code in PR #3923:
URL: https://github.com/apache/iggy/pull/3923#discussion_r3876377518
##########
core/configs/src/server_config/validators.rs:
##########
@@ -424,6 +429,38 @@ fn reject_unsupported(config: &ServerConfig) -> Result<(),
ConfigurationError> {
Ok(())
}
+impl ServerConfig {
+ /// `tcp.address` must name a bind address, and a wildcard one must be
+ /// paired with a declared client-facing address.
+ fn validate_client_facing_address(&self) -> Result<(), ConfigurationError>
{
+ let bind = self.tcp.address.parse::<SocketAddr>().map_err(|error| {
+ eprintln!(
+ "{COMPONENT} - tcp.address '{}' is not an address and port:
{error}. The host \
+ is required and must be a literal IP, so ':PORT' and
'hostname:PORT' are \
+ both rejected; use 127.0.0.1:PORT for loopback or
0.0.0.0:PORT to accept on \
+ every interface.",
+ self.tcp.address
+ );
+ ConfigurationError::InvalidConfigurationValue
+ })?;
+
+ if self.cluster.enabled || self.node.advertised_address.is_some() {
Review Comment:
done
##########
core/configs/src/server_config/cluster.rs:
##########
@@ -990,10 +1047,23 @@ impl Validatable<ConfigurationError> for ClusterConfig {
return Err(ConfigurationError::InvalidConfigurationValue);
}
- if node.ip.trim().is_empty() {
+ // The roster ip is dialed verbatim for replica traffic and is
+ // never resolved, so no hostname can work here whatever its
+ // shape.
+ let node_ip = node.ip.parse::<IpAddr>().map_err(|error| {
eprintln!(
- "Invalid cluster configuration: IP cannot be empty for
node '{}'",
- node.name
+ "Invalid cluster configuration: IP '{}' for node '{}' is
not a literal IP \
+ address: {error}; set node.advertised_address for the
name clients dial",
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]