Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
7d217547
Commit
7d217547
authored
Jul 19, 2019
by
Madelyn Olson
Browse files
Hide HELLO and AUTH from slowlog and monitor
parent
f674e832
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/server.c
View file @
7d217547
...
...
@@ -146,6 +146,8 @@ volatile unsigned long lru_clock; /* Server global current LRU time. */
* in this condition but just a few.
*
* no-monitor: Do not automatically propagate the command on MONITOR.
*
* no-slowlog: Do not automatically propagate the command to the slowlog.
*
* cluster-asking: Perform an implicit ASKING for this command, so the
* command will be accepted in cluster mode if the slot is marked
...
...
@@ -627,7 +629,7 @@ struct redisCommand redisCommandTable[] = {
0
,
NULL
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"auth"
,
authCommand
,
-
2
,
"no-script ok-loading ok-stale fast @connection"
,
"no-script ok-loading ok-stale fast
no-monitor no-slowlog
@connection"
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
,
0
},
/* We don't allow PING during loading since in Redis PING is used as
...
...
@@ -670,7 +672,7 @@ struct redisCommand redisCommandTable[] = {
0
,
NULL
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"exec"
,
execCommand
,
1
,
"no-script no-monitor @transaction"
,
"no-script no-monitor
no-slowlog
@transaction"
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"discard"
,
discardCommand
,
1
,
...
...
@@ -822,7 +824,7 @@ struct redisCommand redisCommandTable[] = {
0
,
NULL
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"hello"
,
helloCommand
,
-
2
,
"no-script fast @connection"
,
"no-script fast
no-monitor no-slowlog
@connection"
,
0
,
NULL
,
0
,
0
,
0
,
0
,
0
,
0
},
/* EVAL can modify the dataset, however it is not flagged as a write
...
...
@@ -2902,6 +2904,8 @@ int populateCommandTableParseFlags(struct redisCommand *c, char *strflags) {
c
->
flags
|=
CMD_STALE
;
}
else
if
(
!
strcasecmp
(
flag
,
"no-monitor"
))
{
c
->
flags
|=
CMD_SKIP_MONITOR
;
}
else
if
(
!
strcasecmp
(
flag
,
"no-slowlog"
))
{
c
->
flags
|=
CMD_SKIP_SLOWLOG
;
}
else
if
(
!
strcasecmp
(
flag
,
"cluster-asking"
))
{
c
->
flags
|=
CMD_ASKING
;
}
else
if
(
!
strcasecmp
(
flag
,
"fast"
))
{
...
...
@@ -3186,7 +3190,7 @@ void call(client *c, int flags) {
/* Log the command into the Slow log if needed, and populate the
* per-command statistics that we show in INFO commandstats. */
if
(
flags
&
CMD_CALL_SLOWLOG
&&
c
->
cmd
->
proc
!=
execCommand
)
{
if
(
flags
&
CMD_CALL_SLOWLOG
&&
!
(
c
->
flags
&
CMD_SKIP_SLOWLOG
)
)
{
char
*
latency_event
=
(
c
->
cmd
->
flags
&
CMD_FAST
)
?
"fast-command"
:
"command"
;
latencyAddSampleIfNeeded
(
latency_event
,
duration
/
1000
);
...
...
@@ -3677,6 +3681,7 @@ void addReplyCommand(client *c, struct redisCommand *cmd) {
flagcount
+=
addReplyCommandFlag
(
c
,
cmd
,
CMD_LOADING
,
"loading"
);
flagcount
+=
addReplyCommandFlag
(
c
,
cmd
,
CMD_STALE
,
"stale"
);
flagcount
+=
addReplyCommandFlag
(
c
,
cmd
,
CMD_SKIP_MONITOR
,
"skip_monitor"
);
flagcount
+=
addReplyCommandFlag
(
c
,
cmd
,
CMD_SKIP_SLOWLOG
,
"skip_slowlog"
);
flagcount
+=
addReplyCommandFlag
(
c
,
cmd
,
CMD_ASKING
,
"asking"
);
flagcount
+=
addReplyCommandFlag
(
c
,
cmd
,
CMD_FAST
,
"fast"
);
if
((
cmd
->
getkeys_proc
&&
!
(
cmd
->
flags
&
CMD_MODULE
))
||
...
...
src/server.h
View file @
7d217547
...
...
@@ -218,35 +218,36 @@ typedef long long mstime_t; /* millisecond time type. */
#define CMD_LOADING (1ULL<<9)
/* "ok-loading" flag */
#define CMD_STALE (1ULL<<10)
/* "ok-stale" flag */
#define CMD_SKIP_MONITOR (1ULL<<11)
/* "no-monitor" flag */
#define CMD_ASKING (1ULL<<12)
/* "cluster-asking" flag */
#define CMD_FAST (1ULL<<13)
/* "fast" flag */
#define CMD_SKIP_SLOWLOG (1ULL<<12)
/* "no-slowlog" flag */
#define CMD_ASKING (1ULL<<13)
/* "cluster-asking" flag */
#define CMD_FAST (1ULL<<14)
/* "fast" flag */
/* Command flags used by the module system. */
#define CMD_MODULE_GETKEYS (1ULL<<1
4
)
/* Use the modules getkeys interface. */
#define CMD_MODULE_NO_CLUSTER (1ULL<<1
5
)
/* Deny on Redis Cluster. */
#define CMD_MODULE_GETKEYS (1ULL<<1
5
)
/* Use the modules getkeys interface. */
#define CMD_MODULE_NO_CLUSTER (1ULL<<1
6
)
/* Deny on Redis Cluster. */
/* Command flags that describe ACLs categories. */
#define CMD_CATEGORY_KEYSPACE (1ULL<<1
6
)
#define CMD_CATEGORY_READ (1ULL<<1
7
)
#define CMD_CATEGORY_WRITE (1ULL<<1
8
)
#define CMD_CATEGORY_SET (1ULL<<
19
)
#define CMD_CATEGORY_SORTEDSET (1ULL<<2
0
)
#define CMD_CATEGORY_LIST (1ULL<<2
1
)
#define CMD_CATEGORY_HASH (1ULL<<2
2
)
#define CMD_CATEGORY_STRING (1ULL<<2
3
)
#define CMD_CATEGORY_BITMAP (1ULL<<2
4
)
#define CMD_CATEGORY_HYPERLOGLOG (1ULL<<2
5
)
#define CMD_CATEGORY_GEO (1ULL<<2
6
)
#define CMD_CATEGORY_STREAM (1ULL<<2
7
)
#define CMD_CATEGORY_PUBSUB (1ULL<<2
8
)
#define CMD_CATEGORY_ADMIN (1ULL<<
29
)
#define CMD_CATEGORY_FAST (1ULL<<3
0
)
#define CMD_CATEGORY_SLOW (1ULL<<3
1
)
#define CMD_CATEGORY_BLOCKING (1ULL<<3
2
)
#define CMD_CATEGORY_DANGEROUS (1ULL<<3
3
)
#define CMD_CATEGORY_CONNECTION (1ULL<<3
4
)
#define CMD_CATEGORY_TRANSACTION (1ULL<<3
5
)
#define CMD_CATEGORY_SCRIPTING (1ULL<<3
6
)
#define CMD_CATEGORY_KEYSPACE (1ULL<<1
7
)
#define CMD_CATEGORY_READ (1ULL<<1
8
)
#define CMD_CATEGORY_WRITE (1ULL<<1
9
)
#define CMD_CATEGORY_SET (1ULL<<
20
)
#define CMD_CATEGORY_SORTEDSET (1ULL<<2
1
)
#define CMD_CATEGORY_LIST (1ULL<<2
2
)
#define CMD_CATEGORY_HASH (1ULL<<2
3
)
#define CMD_CATEGORY_STRING (1ULL<<2
4
)
#define CMD_CATEGORY_BITMAP (1ULL<<2
5
)
#define CMD_CATEGORY_HYPERLOGLOG (1ULL<<2
6
)
#define CMD_CATEGORY_GEO (1ULL<<2
7
)
#define CMD_CATEGORY_STREAM (1ULL<<2
8
)
#define CMD_CATEGORY_PUBSUB (1ULL<<2
9
)
#define CMD_CATEGORY_ADMIN (1ULL<<
30
)
#define CMD_CATEGORY_FAST (1ULL<<3
1
)
#define CMD_CATEGORY_SLOW (1ULL<<3
2
)
#define CMD_CATEGORY_BLOCKING (1ULL<<3
3
)
#define CMD_CATEGORY_DANGEROUS (1ULL<<3
4
)
#define CMD_CATEGORY_CONNECTION (1ULL<<3
5
)
#define CMD_CATEGORY_TRANSACTION (1ULL<<3
6
)
#define CMD_CATEGORY_SCRIPTING (1ULL<<3
7
)
/* AOF states */
#define AOF_OFF 0
/* AOF is off */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment