{"record":{"id":"9559caea56c71e8a","repo":"risingwavelabs/risingwave","slug":"there-should-be-only-one-load-balance-address","errorCode":null,"errorMessage":"there should be only one load balance address","messagePattern":"there should be only one load balance address","errorType":"validation","errorClass":"MetaAddressStrategyParseError","httpStatus":null,"severity":"error","filePath":"src/common/src/util/meta_addr.rs","lineNumber":36,"sourceCode":"use itertools::Itertools;\n\nconst META_ADDRESS_LOAD_BALANCE_MODE_PREFIX: &str = \"load-balance+\";\n\n/// The strategy for meta client to connect to meta node.\n///\n/// Used in the command line argument `--meta-address`.\n#[derive(Debug, Eq, PartialEq, Clone)]\npub enum MetaAddressStrategy {\n    LoadBalance(http::Uri),\n    List(Vec<http::Uri>),\n}\n\n/// Error type for parsing meta address strategy.\n#[derive(thiserror::Error, Debug, thiserror_ext::ContextInto)]\npub enum MetaAddressStrategyParseError {\n    #[error(\"empty meta addresses\")]\n    Empty,\n    #[error(\"there should be only one load balance address\")]\n    MultipleLoadBalance,\n    #[error(\"failed to parse meta address `{1}`: {0}\")]\n    UrlParse(#[source] http::uri::InvalidUri, String),\n}\n\nimpl FromStr for MetaAddressStrategy {\n    type Err = MetaAddressStrategyParseError;\n\n    fn from_str(meta_addr: &str) -> Result<Self, Self::Err> {\n        if let Some(addr) = meta_addr.strip_prefix(META_ADDRESS_LOAD_BALANCE_MODE_PREFIX) {\n            // UFCS pins this to `itertools::Itertools::exactly_one`; a future\n            // stabilization of `Iterator::exactly_one` (rust#48919) would otherwise\n            // make the bare method call ambiguous / silently rebind.\n            let addr = Itertools::exactly_one(addr.split(','))\n                .map_err(|_| MetaAddressStrategyParseError::MultipleLoadBalance)?;\n\n            let uri = addr.parse().into_url_parse(addr)?;\n","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/common/src/util/meta_addr.rs#L18-L54","documentation":"When parsing a meta address strategy, RisingWave allows either plain per-node addresses or exactly one load-balance (LB) address that fronts all meta nodes. `MultipleLoadBalance` is returned if more than one address in the list is marked as load-balanced, because the strategy would be ambiguous — it cannot tell which LB address the meta nodes sit behind.","triggerScenarios":"Passing a meta address list containing two or more LB-flagged addresses (e.g. `lb://lb1,lb://lb2` or two addresses both wrapped in the LB scheme/marker) to `MetaAddressStrategy::from_str` via `--meta-address`.","commonSituations":"Deployments fronted by multiple load balancers (e.g. one per region) where operators list all LB endpoints; copy-pasting LB endpoints from different environments; mixing direct node addresses and several LB addresses in one flag.","solutions":["Keep at most one load-balanced address in the list; remove the extras","If multiple LB endpoints must be reachable, pick one canonical LB address and point the rest of the topology at it, or list individual node addresses instead","Mixing is not supported: use either all direct node addresses plus at most one LB address — verify with the strategy grammar in src/common/src/util/meta_addr.rs"],"exampleFix":"// before\n--meta-address \"lb://lb-a:5690,lb://lb-b:5690\"\n// after\n--meta-address \"lb://lb-a:5690\"   // exactly one LB address","handlingStrategy":"validation","validationCode":"// count load-balanced entries before parsing\nlet lb_count = raw.split(',')\n    .map(str::trim)\n    .filter(|a| a.starts_with(\"lb://\"))\n    .count();\nif lb_count > 1 {\n    return Err(\"at most one lb:// address is allowed in the meta address list\");\n}\n","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use a single canonical load-balancer endpoint per cluster","Do not list multiple regional LB endpoints in one --meta-address value","Keep LB and direct node addressing styles consistent across deployment configs"],"tags":["risingwave","config","load-balance","meta-node"],"backgroundTag":"invalid-config-value","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}