Repository navigation
Resolve empty ASK and MOVED hosts from the replying connection - #787
Conversation
|
🤖 Automated first-pass review — a human maintainer's review is still required before merge. Thanks, this is small and well scoped. The empty-host substitution only runs when One question, not blocking: the match is still an exact string compare against each connection's stored The core fix looks right to me. |
|
Thanks. I checked this path and added independent runtime controls. The bootstrap seed does not retain the raw Both the semantics and test reviewers ran Arbitrary hostname aliases advertised for nonseed connections still use the existing exact-string matching policy; this change does not add DNS alias equivalence. The core fix remains substitution of the actual replying connection's stored endpoint while preserving the redirect port. |
Problem
An empty host in a cluster ASK or MOVED redirect is valid: it means the endpoint of the connection that received the reply, with the redirected port. memtier instead compares that empty string against known primary addresses, fails to identify the target and retries the stale slot owner. A bounded run can exhaust retries without executing its requests on the target.
Root cause
The shared redirect resolver parses the host literally and has no receiving-connection identity. A refreshed slot map cannot repair ASK during an ongoing migration, and MOVED can arrive before updated topology is available.
Fix
Pass the receiving connection ID to the existing resolver. Substitute its stored endpoint only when the redirect host is empty, preserving the redirected port. Keep explicit hosts, primary-role/readiness checks, retry ownership and ASKING behavior unchanged. Do not substitute the original seed endpoint.
Tests
Affected versions
Directly reproduced on current base
cae16bf6a2c1bce7df051b3db45e4f6c89dfccaeand the independently tested #777 topology-normalization head. Retry support entered in08cfc24ac3a056fadbaac7a225ed260aee8f6431, first released in 2.4.0. Releases 2.4.0–2.5.2 have the broader ASK-routing limitation; this range is source/history attribution, not execution of every release. Unreleasedac5dca8d66fc84d27bb675d204641e7e0078a247fixed explicit-host ASK forwarding but left this empty-host variant. The shared resolver also handles MOVED, now covered by the paired controls. No fixed release exists yet.Fixes #780
🤖 Generated with Claude Code