Skip to content

Commit

Permalink
A few non-data commands that should be allowed while loading or stale
Browse files Browse the repository at this point in the history
SELECT, and HELLO are commands that may be executed by the client
as soon as it connects, there's no reason to block them, preventing the
client from doing the rest of his sequence (which might just be INFO or
CONFIG, etc).

MONITOR, DEBUG, SLOWLOG, TIME, LASTSAVE are all non-data accessing
commands, which there's no reason to block.
  • Loading branch information
oranagra authored and jschmieg committed Mar 24, 2020
1 parent fa22e65 commit 927e7b1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ struct redisCommand redisCommandTable[] = {
0,NULL,0,0,0,0,0,0},

{"select",selectCommand,2,
"ok-loading fast @keyspace",
"ok-loading fast ok-stale @keyspace",
0,NULL,0,0,0,0,0,0},

{"swapdb",swapdbCommand,3,
Expand Down Expand Up @@ -660,7 +660,7 @@ struct redisCommand redisCommandTable[] = {
0,NULL,0,0,0,0,0,0},

{"lastsave",lastsaveCommand,1,
"read-only random fast @admin @dangerous",
"read-only random fast ok-loading ok-stale @admin @dangerous",
0,NULL,0,0,0,0,0,0},

{"type",typeCommand,2,
Expand Down Expand Up @@ -708,7 +708,7 @@ struct redisCommand redisCommandTable[] = {
0,NULL,0,0,0,0,0,0},

{"monitor",monitorCommand,1,
"admin no-script",
"admin no-script ok-loading ok-stale",
0,NULL,0,0,0,0,0,0},

{"ttl",ttlCommand,2,
Expand Down Expand Up @@ -740,7 +740,7 @@ struct redisCommand redisCommandTable[] = {
0,NULL,0,0,0,0,0,0},

{"debug",debugCommand,-2,
"admin no-script",
"admin no-script ok-loading ok-stale",
0,NULL,0,0,0,0,0,0},

{"config",configCommand,-2,
Expand Down Expand Up @@ -820,11 +820,11 @@ struct redisCommand redisCommandTable[] = {
0,memoryGetKeys,0,0,0,0,0,0},

{"client",clientCommand,-2,
"admin no-script random @connection",
"admin no-script random ok-loading ok-stale @connection",
0,NULL,0,0,0,0,0,0},

{"hello",helloCommand,-2,
"no-auth no-script fast no-monitor no-slowlog @connection",
"no-auth no-script fast no-monitor ok-loading ok-stale no-slowlog @connection",
0,NULL,0,0,0,0,0,0},

/* EVAL can modify the dataset, however it is not flagged as a write
Expand All @@ -838,15 +838,15 @@ struct redisCommand redisCommandTable[] = {
0,evalGetKeys,0,0,0,0,0,0},

{"slowlog",slowlogCommand,-2,
"admin random",
"admin random ok-loading ok-stale",
0,NULL,0,0,0,0,0,0},

{"script",scriptCommand,-2,
"no-script @scripting",
0,NULL,0,0,0,0,0,0},

{"time",timeCommand,1,
"read-only random fast",
"read-only random fast ok-loading ok-stale",
0,NULL,0,0,0,0,0,0},

{"bitop",bitopCommand,-4,
Expand Down

0 comments on commit 927e7b1

Please sign in to comment.