Merge "Fix weighted round-robin about UDP and SCTP listener"

This commit is contained in:
Zuul 2021-04-01 17:19:50 +00:00 committed by Gerrit Code Review
commit bd01ad94dc
4 changed files with 25 additions and 19 deletions

View File

@ -30,7 +30,7 @@ PROTOCOL_MAP = {
}
BALANCE_MAP = {
constants.LB_ALGORITHM_ROUND_ROBIN: 'rr',
constants.LB_ALGORITHM_ROUND_ROBIN: 'wrr',
constants.LB_ALGORITHM_LEAST_CONNECTIONS: 'lc',
constants.LB_ALGORITHM_SOURCE_IP: 'sh'
}

View File

@ -42,7 +42,7 @@ class TestLvsCfg(base.TestCase):
"# Configuration for Listener sample_listener_id_1\n\n"
"net_namespace amphora-haproxy\n\n"
"virtual_server 10.0.0.2 80 {\n"
" lb_algo rr\n"
" lb_algo wrr\n"
" lb_kind NAT\n"
" protocol UDP\n"
" persistence_timeout 33\n"
@ -88,7 +88,7 @@ class TestLvsCfg(base.TestCase):
"# Configuration for Listener sample_listener_id_1\n\n"
"net_namespace amphora-haproxy\n\n"
"virtual_server 10.0.0.2 80 {\n"
" lb_algo rr\n"
" lb_algo wrr\n"
" lb_kind NAT\n"
" protocol UDP\n"
" delay_loop 30\n"
@ -131,7 +131,7 @@ class TestLvsCfg(base.TestCase):
"# Configuration for Listener sample_listener_id_1\n\n"
"net_namespace amphora-haproxy\n\n"
"virtual_server 10.0.0.2 80 {\n"
" lb_algo rr\n"
" lb_algo wrr\n"
" lb_kind NAT\n"
" protocol UDP\n"
" delay_loop 30\n"
@ -174,7 +174,7 @@ class TestLvsCfg(base.TestCase):
"# Configuration for Listener sample_listener_id_1\n\n"
"net_namespace amphora-haproxy\n\n"
"virtual_server 10.0.0.2 80 {\n"
" lb_algo rr\n"
" lb_algo wrr\n"
" lb_kind NAT\n"
" protocol UDP\n"
" delay_loop 30\n"
@ -229,7 +229,7 @@ class TestLvsCfg(base.TestCase):
"# Configuration for Listener sample_listener_id_1\n\n"
"net_namespace amphora-haproxy\n\n"
"virtual_server 10.0.0.2 80 {\n"
" lb_algo rr\n"
" lb_algo wrr\n"
" lb_kind NAT\n"
" protocol UDP\n\n\n"
" # Configuration for Pool sample_pool_id_0\n"
@ -247,7 +247,7 @@ class TestLvsCfg(base.TestCase):
"# Configuration for Listener sample_listener_id_1\n\n"
"net_namespace amphora-haproxy\n\n"
"virtual_server 10.0.0.2 80 {\n"
" lb_algo rr\n"
" lb_algo wrr\n"
" lb_kind NAT\n"
" protocol UDP\n\n\n"
" # Pool sample_pool_id_1 is disabled\n"
@ -358,7 +358,7 @@ class TestLvsCfg(base.TestCase):
"# Configuration for Listener sample_listener_id_1\n\n"
"net_namespace amphora-haproxy\n\n"
"virtual_server 10.0.0.2 80 {\n"
" lb_algo rr\n"
" lb_algo wrr\n"
" lb_kind NAT\n"
" protocol UDP\n"
" delay_loop 30\n"
@ -419,7 +419,7 @@ class TestLvsCfg(base.TestCase):
"# Configuration for Listener sample_listener_id_1\n\n"
"net_namespace amphora-haproxy\n\n"
"virtual_server 10.0.0.2 80 {\n"
" lb_algo rr\n"
" lb_algo wrr\n"
" lb_kind NAT\n"
" protocol UDP\n"
" delay_loop 30\n"
@ -477,7 +477,7 @@ class TestLvsCfg(base.TestCase):
"# Configuration for Listener sample_listener_id_1\n\n"
"net_namespace amphora-haproxy\n\n"
"virtual_server 10.0.0.2 80 {\n"
" lb_algo rr\n"
" lb_algo wrr\n"
" lb_kind NAT\n"
" protocol SCTP\n"
" persistence_timeout 33\n"
@ -523,7 +523,7 @@ class TestLvsCfg(base.TestCase):
"# Configuration for Listener sample_listener_id_1\n\n"
"net_namespace amphora-haproxy\n\n"
"virtual_server 10.0.0.2 80 {\n"
" lb_algo rr\n"
" lb_algo wrr\n"
" lb_kind NAT\n"
" protocol SCTP\n"
" delay_loop 30\n"
@ -566,7 +566,7 @@ class TestLvsCfg(base.TestCase):
"# Configuration for Listener sample_listener_id_1\n\n"
"net_namespace amphora-haproxy\n\n"
"virtual_server 10.0.0.2 80 {\n"
" lb_algo rr\n"
" lb_algo wrr\n"
" lb_kind NAT\n"
" protocol SCTP\n"
" delay_loop 30\n"
@ -609,7 +609,7 @@ class TestLvsCfg(base.TestCase):
"# Configuration for Listener sample_listener_id_1\n\n"
"net_namespace amphora-haproxy\n\n"
"virtual_server 10.0.0.2 80 {\n"
" lb_algo rr\n"
" lb_algo wrr\n"
" lb_kind NAT\n"
" protocol SCTP\n"
" delay_loop 30\n"
@ -749,7 +749,7 @@ class TestLvsCfg(base.TestCase):
"# Configuration for Listener sample_listener_id_1\n\n"
"net_namespace amphora-haproxy\n\n"
"virtual_server 10.0.0.2 80 {\n"
" lb_algo rr\n"
" lb_algo wrr\n"
" lb_kind NAT\n"
" protocol SCTP\n"
" delay_loop 30\n"
@ -810,7 +810,7 @@ class TestLvsCfg(base.TestCase):
"# Configuration for Listener sample_listener_id_1\n\n"
"net_namespace amphora-haproxy\n\n"
"virtual_server 10.0.0.2 80 {\n"
" lb_algo rr\n"
" lb_algo wrr\n"
" lb_kind NAT\n"
" protocol SCTP\n"
" delay_loop 30\n"

View File

@ -461,7 +461,7 @@ RET_UDP_POOL = {
'id': 'sample_pool_id_1',
'enabled': True,
'health_monitor': RET_UDP_HEALTH_MONITOR,
'lb_algorithm': 'rr',
'lb_algorithm': 'wrr',
'members': [UDP_MEMBER_1, UDP_MEMBER_2],
'protocol': 'udp',
'session_persistence': UDP_SOURCE_IP_BODY
@ -473,7 +473,7 @@ RET_UDP_LISTENER = {
'id': 'sample_pool_id_1',
'enabled': True,
'health_monitor': RET_UDP_HEALTH_MONITOR,
'lb_algorithm': 'rr',
'lb_algorithm': 'wrr',
'members': [UDP_MEMBER_1, UDP_MEMBER_2],
'protocol': 'udp',
'session_persistence': UDP_SOURCE_IP_BODY
@ -544,7 +544,7 @@ RET_SCTP_POOL = {
'id': 'sample_pool_id_1',
'enabled': True,
'health_monitor': RET_SCTP_HEALTH_MONITOR,
'lb_algorithm': 'rr',
'lb_algorithm': 'wrr',
'members': [SCTP_MEMBER_1, SCTP_MEMBER_2],
'protocol': 'sctp',
'session_persistence': SCTP_SOURCE_IP_BODY
@ -556,7 +556,7 @@ RET_SCTP_LISTENER = {
'id': 'sample_pool_id_1',
'enabled': True,
'health_monitor': RET_SCTP_HEALTH_MONITOR,
'lb_algorithm': 'rr',
'lb_algorithm': 'wrr',
'members': [SCTP_MEMBER_1, SCTP_MEMBER_2],
'protocol': 'sctp',
'session_persistence': SCTP_SOURCE_IP_BODY

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Fix weighted round-robin for UDP and SCTP listeners with keepalived and
lvs. The algorithm must be specified as 'wrr' in order for weighted
round-robin to work correctly, but was being set to 'rr'.