diff --git a/reg-tests/balance/balance-hash-maxconn.vtc b/reg-tests/balance/balance-hash-maxconn.vtc index 1453ed34b..034be6845 100644 --- a/reg-tests/balance/balance-hash-maxconn.vtc +++ b/reg-tests/balance/balance-hash-maxconn.vtc @@ -9,13 +9,13 @@ barrier b2 cond 2 server s0 { rxreq + barrier b2 sync barrier b1 sync txresp -hdr "Server: s0" } -start server s1 { rxreq - barrier b2 sync barrier b1 sync txresp -hdr "Server: s1" } -start @@ -47,7 +47,7 @@ client c1 -connect ${h1_px_sock} { txreq -url "/test-url" rxresp expect resp.status == 200 - expect resp.http.Server ~ s1 + expect resp.http.Server ~ s0 } -start barrier b2 sync @@ -57,7 +57,7 @@ client c2 -connect ${h1_px_sock} { txreq -url "/test-url" rxresp expect resp.status == 200 - expect resp.http.Server ~ s0 + expect resp.http.Server ~ s1 } -start client c1 -wait diff --git a/src/lb_chash.c b/src/lb_chash.c index f5b075ab3..59300d13a 100644 --- a/src/lb_chash.c +++ b/src/lb_chash.c @@ -123,7 +123,7 @@ static inline u32 chash_compute_server_key(struct server *s) case SRV_HASH_KEY_ID: default: - key = full_hash(s->puid); + key = s->puid * SRV_EWGHT_RANGE; break; }