grpclb: use two-level drop behavior (#3343)
Previously, the round-robin list that the client uses (effective round-robin list, ERRL) was the received round-robin list (RRRL) excluding non-READY backends. Drop and backend entries are in the same list. The problem with it is that when not all backends are READY, drop entries take a larger proportion in ERRL than they do in the RRRL, resulting a larger drop ratio than intended. To fix this, we employ a two-list scheme: - A "drop list" (DL) that is out of the RRRL, with the same size and the same number of drop entries. - A "backend list" (BL) that contains only the backend entries from the RRRL, excluding non-READY ones. For every pick, the client would round-robin on the DL to determine whether the pick should be dropped. Only when it's not dropped, round-robin on the BL to pick the actual backend. This way, the drop ratio is always equal to the proportion they take in the RRRL.
Loading
Please sign in to comment