There's a big issue with redis. I am using this in ruby script

irb(main):026:0> redis.zrangebyscore('feed:home:7', '(-inf', '(+inf', with_scores: true)
=> [["107241582127494388", 1.0724224662752986e+17]]
irb(main):027:0> tid = redis.zrangebyscore('feed:home:7', '(-inf', '(+inf', with_scores: true)[0][1]
=> 1.0724224662752986e+17
irb(main):028:0> redis.zscore('feed:home:7', tid)
=> nil
irb(main):029:0> redis.zadd('feed:home:7', 107241582127494388, 107241582127494388)
=> false
irb(main):031:0> redis.zadd('feed:home:7', 107241582127494389, 107241582127494389)
=> true
irb(main):032:0> redis.zscore('feed:home:7', 107241582127494389)
=> 1.0724158212749438e+17
irb(main):033:0> redis.zscore('feed:home:7', 107241582127494380)
=> nil
irb(main):034:0> redis.zscore('feed:home:7', 107241582127494388)
=> 1.0724158212749438e+17
irb(main):035:0> redis.zscore('"feed:home:7', 107241582127494388)
=> nil
irb(main):036:0> redis.ztrm('feed:home:7', 107241582127494389)
Traceback (most recent call last):
        1: from (irb):36
Redis::CommandError (ERR unknown command `ztrm`, with args beginning with: `feed:home:7`, `107241582127494389`, )
irb(main):037:0> redis.zrem('feed:home:7', 107241582127494389)
=> true
irb(main):038:0> redis.zscore('feed:home:7', 107241582127494388)
=> 1.0724158212749438e+17
irb(main):039:0> tid = redis.zrevrangebyscore('feed:home:7', '(+inf', '(107241582127494388', limit: [0, 20], with_scores: true)
=> []
irb(main):040:0> tid = redis.zrevrangebyscore('feed:home:7', '(+inf', '(-inf', limit: [0, 20], with_scores: true)
=> [["107241582127494388", 1.0724158212749438e+17]]

These are logs from rails console. And There was typo '"feed:home:7' I am putting full logs to help you track issue. I don't think my script changed 107241582127494388. But the key is actually changed.

Comment From: madolson

@adrianomic Can you help me understand what the bug is?

Although 107241582127494388 is an integer, it's being treated as a string in the first argument. The second argument though is being treated as a double. 107241582127494388 is outside the range a double can specify precisely, so it's being truncated and only being reported in scientific notation.

Comment From: adrianomic

@madolson Please check first and last ones Those are supposed to put same result. But they're different. Let me know if any script can update redis value

Comment From: madolson

I see now, thank you for point it out. Let me try to replicate it based on the commands listed here.

Comment From: adrianomic

Thanks @madolson

Comment From: madolson

So it's hard to tell. At the beginning we see that:

107241582127494388 -> 1.0724224662752986e+17

We see that it is later updated by redis.zadd('feed:home:7', 107241582127494388, 107241582127494388) Which, when described a couple lines later shows that

107241582127494388 -> 1.0724158212749438e+17

That all looks correct to me. The original value was something, and then it was updated to something else.

Comment From: adrianomic

That returned false. Still it should update value?

Comment From: adrianomic

Thank you, I see my script had issue