topk icon indicating copy to clipboard operation
topk copied to clipboard

TOPK.ADD issue when topk overflows

Open ancuop opened this issue 8 years ago • 0 comments

I tested case when topk overflows as below:

127.0.0.1:6379> TOPK.ADD KEY 5 K1 K2 K3 K4 K5 (integer) 5 127.0.0.1:6379> TOPK.ADD KEY 5 K1 K2 K3 K4 K5 (integer) 0 127.0.0.1:6379> TOPK.ADD KEY 5 K6 K7 (integer) -2 127.0.0.1:6379> TOPK.PRANK KEY K1 K2 K3 K4 K5 K6 K7

  1. (integer) 50
  2. (nil)
  3. (integer) 50
  4. (nil)
  5. (integer) 50
  6. (integer) 100
  7. (integer) 100

Due to my estimation, the score of K1 to K7 now is 1, and the result of PRANK is not correct, isn't it? I think it is the issue of ADD function. Please help to review if this is a bug. Thanks

ancuop avatar Jun 30 '16 04:06 ancuop