s3: defer a recently-unreachable owner that is also the current filer (#9808)

Blanking preferred kept route-by-key reads from dialing a flagged owner first,
but withFilerClientFailover always re-adds the current filer, so when the owner
is the gateway's current filer it stayed in the candidate list and got dialed
anyway. Treat a recently-unreachable filer as unhealthy in the health partition
so it is deferred to the last-resort tail instead of tried before healthy
replicas; preferred is still tried first, and a live owner is unaffected.
This commit is contained in:
Chris Lu
2026-06-03 00:28:56 -07:00
committed by GitHub
parent 2d1b8be22b
commit ef1aa4f936
+5 -5
View File
@@ -58,16 +58,16 @@ func (s3a *S3ApiServer) withFilerClientFailover(preferred pb.ServerAddress, stre
addCandidate(filer)
}
// An explicit preferred owner is tried first even if health-flagged: demoting it
// behind a healthy replica would let that replica's authoritative NotFound mask a
// write that has only reached the owner. Health-order the rest, unhealthy ones
// last so a request still progresses when all are flagged.
// preferred (the routed owner) is tried first even when health-flagged, so a
// replica's authoritative NotFound can't mask a write that only reached the owner.
// A recently-unreachable filer counts as unhealthy, deferring a dead owner that is
// also the current filer to the tail rather than dialing it before healthy replicas.
var healthy, unhealthy []pb.ServerAddress
for _, filer := range candidates {
if filer == preferred {
continue
}
if s3a.filerClient.ShouldSkipUnhealthyFiler(filer) {
if s3a.filerClient.ShouldSkipUnhealthyFiler(filer) || s3a.ownerRecentlyUnreachable(filer) {
unhealthy = append(unhealthy, filer)
} else {
healthy = append(healthy, filer)