mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 17:17:06 +02:00
CLEANUP: backend: remove impossible case of round-robin + consistent hash
In 1.4, consistent hashing was brought by commit 6b2e11be1
("[MEDIUM]
backend: implement consistent hashing variation") which took care of
replacing all direct calls to map_get_server_rr() with an alternate
call to chash_get_next_server() if consistent hash was being used.
One of them, however, cannot happen because a preliminary test for
static round-robin is being done prior to the call, so we're certain
that if it matches it cannot use a consistent hash tree.
Let's remove it.
This commit is contained in:
parent
772e968b06
commit
5ffb045ed1
@ -679,10 +679,9 @@ int assign_server(struct stream *s)
|
|||||||
case BE_LB_LKUP_CHTREE:
|
case BE_LB_LKUP_CHTREE:
|
||||||
case BE_LB_LKUP_MAP:
|
case BE_LB_LKUP_MAP:
|
||||||
if ((s->be->lbprm.algo & BE_LB_KIND) == BE_LB_KIND_RR) {
|
if ((s->be->lbprm.algo & BE_LB_KIND) == BE_LB_KIND_RR) {
|
||||||
|
/* static-rr (map) or random (chash) */
|
||||||
if ((s->be->lbprm.algo & BE_LB_PARM) == BE_LB_RR_RANDOM)
|
if ((s->be->lbprm.algo & BE_LB_PARM) == BE_LB_RR_RANDOM)
|
||||||
srv = get_server_rnd(s, prev_srv);
|
srv = get_server_rnd(s, prev_srv);
|
||||||
else if ((s->be->lbprm.algo & BE_LB_LKUP) == BE_LB_LKUP_CHTREE)
|
|
||||||
srv = chash_get_next_server(s->be, prev_srv);
|
|
||||||
else
|
else
|
||||||
srv = map_get_server_rr(s->be, prev_srv);
|
srv = map_get_server_rr(s->be, prev_srv);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user