The reason selection reads Available rather than the whole pool is so a down backend simply drops out of the rotation. Today you pin that behavior for round-robin.
Confirm round-robin never returns a down backend and cycles only through the healthy ones.
This lesson is a payoff for the design choice you made two lessons ago: because
Select reads Available() and Available filters out down backends, marking B
down removes it from the rotation with no change to the round-robin code at all.
The cycle collapses from three backends to two, and the modulo now wraps over
length 2, so you get A, C, A, C.
A green test with no new production code is exactly the right outcome here - it
proves the seam between health and selection holds. The subtle part is that the
counter n keeps climbing regardless of how many backends are available, and the
% len(avail) is evaluated fresh each call. That is what lets the rotation adapt
the instant a backend’s health changes, which you will pin as a live flap much
later in the project.
// No new code should be needed: because Select() reads Available(),// and Available() already filters out down backends, B is excluded.// The counter n is taken modulo len(avail), which is now 2, not 3.