Parse a `JoinResponse::error` string as a leader redirect hint. The prefix is defined as a shared constant in `rpc_codec` (`LEADER_REDIRECT_PREFIX`) so the producer side (`raft_loop::join::join_flow`) and this consumer can never drift. Any other kind of rejection (collision, parse error, catalog persist failure, commit timeout, etc.) is treated as a hard failure that bubbles through the normal er
(error: &str)
| 55 | /// expected prefix, or where the address portion does not parse |
| 56 | /// as a valid `SocketAddr`. |
| 57 | pub(crate) fn parse_leader_hint(error: &str) -> Option<SocketAddr> { |
| 58 | error |
| 59 | .strip_prefix(LEADER_REDIRECT_PREFIX) |
| 60 | .and_then(|s| s.trim().parse().ok()) |
| 61 | } |
| 62 | |
| 63 | /// Join an existing cluster by contacting seed nodes. |
| 64 | /// |
no test coverage detected