Redis records INCRBYFLOAT and HINCRBYFLOAT as SET and HSET in the Slo.
$ redis-cli info|grep version
redis_version:3.2.8
gcc_version:4.2.1
$ redis-cli slowlog reset
OK
$ epoch 1488174764
$ redis-cli config set slowlog-log-slower-than 1
OK
$ redis-cli slowlog reset
OK
$ redis-cli SET foo 0.0
OK
$ redis-cli INCRBYFLOAT foo 3.14
"3.14"
$ redis-cli INCRBYFLOAT foo 3.14
"6.28"
$ redis-cli slowlog get 128
1) 1) (integer) 11
2) (integer) 1488186785
3) (integer) 12
4) 1) "SET"
2) "foo"
3) "6.28"
2) 1) (integer) 10
2) (integer) 1488186783
3) (integer) 29
4) 1) "SET"
2) "foo"
3) "3.14"
3) 1) (integer) 9
2) (integer) 1488186775
3) (integer) 13
4) 1) "SET"
2) "foo"
3) "0.0"
4) 1) (integer) 8
2) (integer) 1488186767
3) (integer) 4
4) 1) "slowlog"
2) "reset"
$ redis-cli hset bar x 3.2
(integer) 1
$ redis-cli hincrbyfloat bar x 3.4
"6.6"
$ redis-cli slowlog get 128
1) 1) (integer) 14
2) (integer) 1488186942
3) (integer) 23
4) 1) "HSET"
2) "bar"
3) "x"
4) "6.6"
2) 1) (integer) 13
2) (integer) 1488186933
3) (integer) 211
4) 1) "hset"
2) "bar"
3) "x"
4) "3.2"
3) 1) (integer) 12
2) (integer) 1488186789
3) (integer) 15
4) 1) "slowlog"
2) "get"
3) "128"
4) 1) (integer) 11
2) (integer) 1488186785
3) (integer) 12
4) 1) "SET"
2) "foo"
3) "6.28"
5) 1) (integer) 10
2) (integer) 1488186783
3) (integer) 29
4) 1) "SET"
2) "foo"
3) "3.14"
6) 1) (integer) 9
2) (integer) 1488186775
3) (integer) 13
4) 1) "SET"
2) "foo"
3) "0.0"
7) 1) (integer) 8
2) (integer) 1488186767
3) (integer) 4
4) 1) "slowlog"
2) "reset"
I guess Redis rewrites these commands for replication.
- https://github.com/antirez/redis/blob/04542cff92147b9b686a2071c4c53574771f4f88/src/t_string.c#L426-L432
- https://github.com/antirez/redis/blob/d680eb6dbdf2d2030cb96edfb089be1e2a775ac1/src/t_hash.c#L632-L641
But I think it should appear the original command in the output of SLOWLOG command.
Comment From: antirez
Hello, yes this is a bug, there is no immediate quick fix, some design is needed in order to understand what's the best way in order to retain the original information.
Comment From: patil16nit
@antirez I am new for redis contribution and want to catch up with redis code base further improvements. For reported bug, I have submitted the quick fix. Please correct me if I failed to match requirements. I agree on your comment of design change to retain original information but if we check slowlog properly, the requirement of log provision gets satisfied fully.