-
Notifications
You must be signed in to change notification settings - Fork 653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correctly recode client infomation to the slowlog when runing script #805
Conversation
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. Signed-off-by: Binbin <binloveplay1314@qq.com>
before:
after:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## unstable #805 +/- ##
============================================
- Coverage 70.44% 70.34% -0.10%
============================================
Files 112 112
Lines 61135 61265 +130
============================================
+ Hits 43066 43099 +33
- Misses 18069 18166 +97
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit on the fence. On one side the client didn't actually execute these commands, they were part of a script that invoked them, but it will probably be clearer to have the client that invoked them display.
So I guess I'm good with this. I left a comment on the test, but find leaving it as sis.
Signed-off-by: Binbin <binloveplay1314@qq.com>
…alkey-io#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 <binloveplay1314@qq.com> Signed-off-by: mwish <maplewish117@gmail.com>
…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 <binloveplay1314@qq.com>
…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 <binloveplay1314@qq.com>
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.