Fix test failure caused by allowing pings during load

Former-commit-id: 569a3d9ff86f4cd74e269391ce1d582e009147ce
This commit is contained in:
John Sully 2021-01-31 07:15:55 +00:00
parent 10a745df65
commit 68ed1292ee
2 changed files with 5 additions and 5 deletions

View File

@ -689,7 +689,7 @@ struct redisCommand redisCommandTable[] = {
* failure detection, and a loading server is considered to be
* not available. */
{"ping",pingCommand,-1,
"ok-stale fast @connection @replication",
"ok-stale ok-loading fast @connection @replication",
0,NULL,0,0,0,0,0,0},
{"echo",echoCommand,2,
@ -3853,8 +3853,8 @@ int processCommand(client *c, int callFlags) {
(c->cmd->proc == execCommand && (c->mstate.cmd_flags & CMD_DENYOOM));
int is_denystale_command = !(c->cmd->flags & CMD_STALE) ||
(c->cmd->proc == execCommand && (c->mstate.cmd_inv_flags & CMD_STALE));
int is_denyloading_command = strcmp(c->cmd->name, "ping") && (!(c->cmd->flags & CMD_LOADING) ||
(c->cmd->proc == execCommand && (c->mstate.cmd_inv_flags & CMD_LOADING)));
int is_denyloading_command = !(c->cmd->flags & CMD_LOADING) ||
(c->cmd->proc == execCommand && (c->mstate.cmd_inv_flags & CMD_LOADING));
/* Check if the user is authenticated. This check is skipped in case
* the default user is flagged as "nopass" and is active. */

View File

@ -449,7 +449,7 @@ start_server {tags {"scripting"}} {
$rd eval {redis.call('set',KEYS[1],'y'); for i=1,1500000 do redis.call('ping') end return 'ok'} 1 x
$rd flush
after 200
catch {r ping} err
catch {r echo "foo"} err
assert_match {BUSY*} $err
$rd read
set elapsed [expr [clock clicks -milliseconds]-$start]
@ -458,7 +458,7 @@ start_server {tags {"scripting"}} {
$rd debug loadaof
$rd flush
after 200
catch {r ping} err
catch {r echo "foo"} err
assert_match {LOADING*} $err
$rd read
set elapsed [expr [clock clicks -milliseconds]-$start]