File tree 3 files changed +6
-1
lines changed
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[] = {
74
74
{"auth" , CMD_SPEC_DONT_INTERCEPT },
75
75
/* queued by multi, need to intercept
76
76
{"ping", CMD_SPEC_DONT_INTERCEPT }, */
77
- {"ping" , CMD_SPEC_READONLY },
77
+ {"ping" , CMD_SPEC_READONLY | CMD_SPEC_ALLOW_PREINIT },
78
78
{"hello" , CMD_SPEC_DONT_INTERCEPT },
79
79
{"module" , CMD_SPEC_DONT_INTERCEPT },
80
80
{"config" , CMD_SPEC_DONT_INTERCEPT },
Original file line number Diff line number Diff line change @@ -1730,6 +1730,10 @@ static void interceptRedisCommands(RedisModuleCommandFilterCtx *filter)
1730
1730
if (flags != -1 && (flags & CMD_SPEC_DONT_INTERCEPT ))
1731
1731
return ;
1732
1732
1733
+ if (rr -> state != REDIS_RAFT_UP && flags != -1 && (flags & CMD_SPEC_ALLOW_PREINIT )) {
1734
+ return ;
1735
+ }
1736
+
1733
1737
size_t len ;
1734
1738
const char * str = RedisModule_StringPtrLen (cmd , & len );
1735
1739
Original file line number Diff line number Diff line change @@ -686,6 +686,7 @@ typedef struct {
686
686
#define CMD_SPEC_BLOCKING (1 << 8) /* Blocking command */
687
687
#define CMD_SPEC_MULTI (1 << 9) /* a MULTI */
688
688
#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 */
689
690
690
691
/* Command filtering re-entrancy counter handling.
691
692
*
You can’t perform that action at this time.
0 commit comments