Unverified Commit 5f0119ca authored by sundb's avatar sundb Committed by GitHub
Browse files

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: default avatarOran Agra <oran@redislabs.com>
parent a2f2b6f5
...@@ -10809,6 +10809,8 @@ sds genModulesInfoStringRenderModuleOptions(struct RedisModule *module) { ...@@ -10809,6 +10809,8 @@ sds genModulesInfoStringRenderModuleOptions(struct RedisModule *module) {
output = sdscat(output,"handle-io-errors|"); output = sdscat(output,"handle-io-errors|");
if (module->options & REDISMODULE_OPTIONS_HANDLE_REPL_ASYNC_LOAD) if (module->options & REDISMODULE_OPTIONS_HANDLE_REPL_ASYNC_LOAD)
output = sdscat(output,"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 = sdstrim(output,"|");
output = sdscat(output,"]"); output = sdscat(output,"]");
return output; return output;
......
...@@ -236,14 +236,14 @@ typedef uint64_t RedisModuleTimerID; ...@@ -236,14 +236,14 @@ typedef uint64_t RedisModuleTimerID;
/* Declare that the module can handle errors with RedisModule_SetModuleOptions. */ /* Declare that the module can handle errors with RedisModule_SetModuleOptions. */
#define REDISMODULE_OPTIONS_HANDLE_IO_ERRORS (1<<0) #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 /* When set, Redis will not call RedisModule_SignalModifiedKey(), implicitly in
* RedisModule_CloseKey, and the module needs to do that when manually when keys * RedisModule_CloseKey, and the module needs to do that when manually when keys
* are modified from the user's sperspective, to invalidate WATCH. */ * are modified from the user's sperspective, to invalidate WATCH. */
#define REDISMODULE_OPTION_NO_IMPLICIT_SIGNAL_MODIFIED (1<<1) #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. */ /* Definitions for RedisModule_SetCommandInfo. */
typedef enum { typedef enum {
......
...@@ -47,6 +47,12 @@ tags "modules" { ...@@ -47,6 +47,12 @@ tags "modules" {
} }
} }
test {Verify module options info} {
start_server [list overrides [list loadmodule "$testmodule"]] {
assert_match "*\[handle-io-errors|handle-repl-async-load\]*" [r info modules]
}
}
tags {repl} { tags {repl} {
test {diskless loading short read with module} { test {diskless loading short read with module} {
start_server [list overrides [list loadmodule "$testmodule"]] { start_server [list overrides [list loadmodule "$testmodule"]] {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment