Fix chashsubset backend with canary (#7235)
* Fix chashsubset backend with canary * use floor for buckets calculation to remove hot spot * Remove testing code
This commit is contained in:
parent
a14edba8d5
commit
e625c2507a
2 changed files with 19 additions and 2 deletions
|
|
@ -25,7 +25,6 @@ local function build_subset_map(backend)
|
|||
|
||||
local set_count = math.ceil(#endpoints/subset_size)
|
||||
local node_count = set_count * subset_size
|
||||
|
||||
-- if we don't have enough endpoints, we reuse endpoints in the last set to
|
||||
-- keep the same number on all of them.
|
||||
local j = 1
|
||||
|
|
@ -61,7 +60,9 @@ function _M.new(self, backend)
|
|||
instance = resty_chash:new(subset_map),
|
||||
hash_by = complex_val,
|
||||
subsets = subsets,
|
||||
current_endpoints = backend.endpoints
|
||||
current_endpoints = backend.endpoints,
|
||||
traffic_shaping_policy = backend.trafficShapingPolicy,
|
||||
alternative_backends = backend.alternativeBackends,
|
||||
}
|
||||
setmetatable(o, self)
|
||||
self.__index = self
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue