diff options
author | sundb <sundbcn@gmail.com> | 2022-02-12 02:15:52 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-11 20:15:52 +0200 |
commit | 5f0119ca91ad37d8b656d51bcfc46c600d177e8f (patch) | |
tree | fc9cbd0e814b4d30948465c5d4918fe792cb16ec /src | |
parent | a2f2b6f5b19569b5e414a2b9099aa880c070e1ac (diff) | |
download | redis-5f0119ca91ad37d8b656d51bcfc46c600d177e8f.tar.gz |
Fix duplicate module options define (#10284)
The bug is introduced by #9323. (released in 7.0 RC1)
The define of `REDISMODULE_OPTIONS_HANDLE_IO_ERRORS` and `REDISMODULE_OPTION_NO_IMPLICIT_SIGNAL_MODIFIED` have the same value.
This will result in skipping `signalModifiedKey()` after `RM_CloseKey()` if the module has set
`REDISMODULE_OPTIONS_HANDLE_REPL_ASYNC_LOAD` option.
The implication is missing WATCH and client side tracking invalidations.
Other changes:
- add `no-implicit-signal-modified` to the options in INFO modules
Co-authored-by: Oran Agra <oran@redislabs.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/module.c | 2 | ||||
-rw-r--r-- | src/redismodule.h | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/module.c b/src/module.c index 5584fbdd6..8fca2572d 100644 --- a/src/module.c +++ b/src/module.c @@ -10809,6 +10809,8 @@ sds genModulesInfoStringRenderModuleOptions(struct RedisModule *module) { output = sdscat(output,"handle-io-errors|"); if (module->options & REDISMODULE_OPTIONS_HANDLE_REPL_ASYNC_LOAD) output = sdscat(output,"handle-repl-async-load|"); + if (module->options & REDISMODULE_OPTION_NO_IMPLICIT_SIGNAL_MODIFIED) + output = sdscat(output,"no-implicit-signal-modified|"); output = sdstrim(output,"|"); output = sdscat(output,"]"); return output; diff --git a/src/redismodule.h b/src/redismodule.h index 3b125a4ec..aea64174e 100644 --- a/src/redismodule.h +++ b/src/redismodule.h @@ -236,14 +236,14 @@ typedef uint64_t RedisModuleTimerID; /* Declare that the module can handle errors with RedisModule_SetModuleOptions. */ #define REDISMODULE_OPTIONS_HANDLE_IO_ERRORS (1<<0) -/* Declare that the module can handle diskless async replication with RedisModule_SetModuleOptions. */ -#define REDISMODULE_OPTIONS_HANDLE_REPL_ASYNC_LOAD (1<<1) - /* When set, Redis will not call RedisModule_SignalModifiedKey(), implicitly in * RedisModule_CloseKey, and the module needs to do that when manually when keys * are modified from the user's sperspective, to invalidate WATCH. */ #define REDISMODULE_OPTION_NO_IMPLICIT_SIGNAL_MODIFIED (1<<1) +/* Declare that the module can handle diskless async replication with RedisModule_SetModuleOptions. */ +#define REDISMODULE_OPTIONS_HANDLE_REPL_ASYNC_LOAD (1<<2) + /* Definitions for RedisModule_SetCommandInfo. */ typedef enum { |