-
Notifications
You must be signed in to change notification settings - Fork 19
Closed
Description
I'm pretty sure this is wrong:
datafusion-distributed/src/common/ttl_map.rs
Lines 241 to 242 in dd853a7
| let bucket_index = (time.wrapping_sub(1)) % self.buckets.len() as u64; | |
| self.buckets[bucket_index as usize].register_key(key); |
Assume there's 10 buckets. When inserting a key at time=0, we want the key to go into bucket 9.
However, it ends up going to bucket 5.
(time.wrapping_sub(1)) % self.buckets.len() as u64
= (0 - 1) % 10
= 18,446,744,073,709,551,615 % 10
= 5
Note that time is a u64 that we increment by 1 each time and wraps around to 0.
Prematurely evicting entries in this rare case is not a significant problem, but it's a bug nonetheless.
Metadata
Metadata
Assignees
Labels
No labels