Skip to content
Permalink
Browse files
fix weighted_randomized_load_balancer bug
  • Loading branch information
serverglen committed Jun 22, 2021
1 parent 9c1b453 commit 0756052364ad56a792fa4851560ba6b033c48f97
Showing 1 changed file with 1 addition and 1 deletion.
@@ -57,7 +57,7 @@ bool WeightedRandomizedLoadBalancer::Remove(Servers& bg, const ServerId& id) {
if (iter != bg.server_map.end()) {
size_t index = iter->second;
Server remove_server = bg.server_list[index];
uint32_t weight_diff = bg.server_list.back().weight - remove_server.weight;
int32_t weight_diff = bg.server_list.back().weight - remove_server.weight;
bg.weight_sum -= remove_server.weight;
bg.server_list[index] = bg.server_list.back();
bg.server_list[index].current_weight_sum = remove_server.current_weight_sum + weight_diff;

0 comments on commit 0756052

Please sign in to comment.