Repository navigation
[rust] Recover Admin requests after server address changes - #5401
naivedogger wants to merge 3 commits into
Conversation
|
@fresh-borzoni @loserwang1024 could you review this follow-up to #5390? It handles endpoint discovery after a failed Admin request and limits when the client can replay it. |
loserwang1024
left a comment
There was a problem hiding this comment.
Compared this with the Java implementation and found two recovery edge cases, detailed inline.
| }) | ||
| .await; | ||
| match refreshed { | ||
| Ok(tablet) if replay => send(self.select(tablet.as_ref())?).await, |
There was a problem hiding this comment.
Could we preserve the single retry for requests that are safe to replay even when this refresh fails? Another concurrent metadata update may already have installed a healthy endpoint while this refresh was querying an old one. This branch still returns the original error without trying the updated endpoint.
Java explicitly preserves this behavior in testMetadataRefreshFailureDoesNotPreventRetry. I reproduced the concurrent-update case here as well. For replayable requests, we could select from the current metadata after a refresh failure and retry once if an eligible node exists, while retaining the existing restriction on ambiguous writes.
| // Multi-address startup tries one round. Recovery repeats whole rounds so a | ||
| // responsive bootstrap with a stale node list doesn't delay the next address. | ||
| if target.is_some() { | ||
| Self::retry_bootstrap(bootstrap, round, || {}).await |
There was a problem hiding this comment.
Could we evict the failed bootstrap connection before retrying recovery? The disconnect callback is empty here, and the retry loop does not evict it either. If a bootstrap address sits behind a load balancer, the cached connection can remain attached to an old backend returning no eligible servers, even though a new connection would reach a healthy backend.
Java's MetadataUpdater.tryToInitializeClusterWithRetries() disconnects the failed endpoint before retrying. I reproduced this with a regression test: all four attempts reuse the stale connection; evicting it allows recovery.
Closes #5393