[SWA] fix swa radix cache match_len_since_tombstone update when hits swa_tombstone (#17061)
This commit is contained in:
@@ -821,13 +821,12 @@ class SWARadixCache(BasePrefixCache):
|
|||||||
while len(key) > 0 and child_key in node.children.keys():
|
while len(key) > 0 and child_key in node.children.keys():
|
||||||
child = node.children[child_key]
|
child = node.children[child_key]
|
||||||
|
|
||||||
# update best_value_len and best_last_node if needed
|
if child.swa_tombstone:
|
||||||
if (
|
# update best_value_len and best_last_node if needed
|
||||||
child.swa_tombstone
|
if match_len_since_tombstone >= self.sliding_window_size:
|
||||||
and match_len_since_tombstone >= self.sliding_window_size
|
best_value_len = len(value)
|
||||||
):
|
best_last_node = node
|
||||||
best_value_len = len(value)
|
# reset match_len_since_tombstone if we hit a tombstone node
|
||||||
best_last_node = node
|
|
||||||
match_len_since_tombstone = 0
|
match_len_since_tombstone = 0
|
||||||
|
|
||||||
prefix_len = self.key_match_fn(child.key, key)
|
prefix_len = self.key_match_fn(child.key, key)
|
||||||
|
|||||||
Reference in New Issue
Block a user