File tree Expand file tree Collapse file tree 3 files changed +6
-1
lines changed
Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ static const CommandSpec commands[] = {
7474 {"auth" , CMD_SPEC_DONT_INTERCEPT },
7575 /* queued by multi, need to intercept
7676 {"ping", CMD_SPEC_DONT_INTERCEPT }, */
77- {"ping" , CMD_SPEC_READONLY },
77+ {"ping" , CMD_SPEC_READONLY | CMD_SPEC_ALLOW_PREINIT },
7878 {"hello" , CMD_SPEC_DONT_INTERCEPT },
7979 {"module" , CMD_SPEC_DONT_INTERCEPT },
8080 {"config" , CMD_SPEC_DONT_INTERCEPT },
Original file line number Diff line number Diff line change @@ -1730,6 +1730,10 @@ static void interceptRedisCommands(RedisModuleCommandFilterCtx *filter)
17301730 if (flags != -1 && (flags & CMD_SPEC_DONT_INTERCEPT ))
17311731 return ;
17321732
1733+ if (rr -> state != REDIS_RAFT_UP && flags != -1 && (flags & CMD_SPEC_ALLOW_PREINIT )) {
1734+ return ;
1735+ }
1736+
17331737 size_t len ;
17341738 const char * str = RedisModule_StringPtrLen (cmd , & len );
17351739
Original file line number Diff line number Diff line change @@ -686,6 +686,7 @@ typedef struct {
686686#define CMD_SPEC_BLOCKING (1 << 8) /* Blocking command */
687687#define CMD_SPEC_MULTI (1 << 9) /* a MULTI */
688688#define CMD_SPEC_SUBCOMMAND (1 << 10) /* a command with subcommand specs */
689+ #define CMD_SPEC_ALLOW_PREINIT (1 <<11) /* if redisraft hasn't been initialized yet, allow non intercepted */
689690
690691/* Command filtering re-entrancy counter handling.
691692 *
You can’t perform that action at this time.
0 commit comments