Description
The default replica selector chooses a replica on whether the broker.rack matches the client.rack in the fetch request and whether the offset exists in the follower. If the follower is not in the ISR, we know it's lagging behind which will also lag the consumer behind. Let's consider two cases:
- the follower recovers and joins the isr. the consumer will no longer lag
- the follower continues to lag behind. after 5 minutes, the consumer will refresh the preferred read replica and it returns the same lagging follower since the offset the consumer will fetch from is capped by the follower's HWM. this can go on indefinitely
If the replica selector chooses a broker in the ISR then we can ensure that at least every 5 minutes the consumer will consume from an up-to-date replica.