Skip to content

Commit

Permalink
Merge pull request #1631 from jikui/9.8-algorithm
Browse files Browse the repository at this point in the history
change the algorithm from least-connection-node to least-connection-m…
  • Loading branch information
jikui authored Jan 25, 2021
2 parents 0e0e4a3 + 7809433 commit 05e994b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ def _get_lb_method(self, method):
elif lb_method == 'RATIO_LEAST_CONNECTIONS':
return 'ratio-least-connections-member'
elif lb_method == 'SOURCE_IP':
return 'least-connections-node'
return 'least-connections-member'
elif lb_method == 'OBSERVED_MEMBER':
return 'observed-member'
elif lb_method == 'PREDICTIVE_MEMBER':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ def test_pool_member_weight_source_ip(self, pool_member_service):
srvc = copy.deepcopy(pool_member_service)
srvc['pool']['lb_algorithm'] = 'SOURCE_IP'
pool = adapter.get_pool(srvc)
assert pool['loadBalancingMode'] == 'least-connections-node'
assert pool['loadBalancingMode'] == 'least-connections-member'

def test_pool_member_weight_bad_lb_method(self, pool_member_service):
'''If lb method is bad and member has weight, lb is changed
Expand Down Expand Up @@ -713,7 +713,7 @@ def test_pool_no_members_source_ip(self, pool_member_service):
del srvc['members']
srvc['pool']['lb_algorithm'] = 'SOURCE_IP'
pool = adapter.get_pool(srvc)
assert pool['loadBalancingMode'] == 'least-connections-node'
assert pool['loadBalancingMode'] == 'least-connections-member'

def test_get_pool_monitor_no_monitor(self, basic_service):
adapter = ServiceModelAdapter(mock.MagicMock())
Expand Down

0 comments on commit 05e994b

Please sign in to comment.