Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correctly recode client infomation to the slowlog when runing script (#…
…805) Currently when we are runing a script, we will passing a fake client. So if the command executed in the script is recoded in the slowlog, the client's ip:port and name information will be empty. before: ``` 127.0.0.1:6379> client setname myclient OK 127.0.0.1:6379> config set slowlog-log-slower-than 0 OK 127.0.0.1:6379> eval "redis.call('ping')" 0 (nil) 127.0.0.1:6379> slowlog get 2 1) 1) (integer) 2 2) (integer) 1721314289 3) (integer) 96 4) 1) "eval" 2) "redis.call('ping')" 3) "0" 5) "127.0.0.1:61106" 6) "myclient" 2) 1) (integer) 1 2) (integer) 1721314289 3) (integer) 4 4) 1) "ping" 5) "" 6) "" ``` after: ``` 127.0.0.1:6379> client setname myclient OK 127.0.0.1:6379> config set slowlog-log-slower-than 0 OK 127.0.0.1:6379> eval "redis.call('ping')" 0 (nil) 127.0.0.1:6379> slowlog get 2 1) 1) (integer) 2 2) (integer) 1721314371 3) (integer) 53 4) 1) "eval" 2) "redis.call('ping')" 3) "0" 5) "127.0.0.1:51983" 6) "myclient" 2) 1) (integer) 1 2) (integer) 1721314371 3) (integer) 1 4) 1) "ping" 5) "127.0.0.1:51983" 6) "myclient" ``` Signed-off-by: Binbin <[email protected]>
- Loading branch information