You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before Valkey 7, we have command: MODULE LOAD path [arg [arg ...]]
And in Valkey, a new command is added: MODULE LOADEX path [CONFIG name value [CONFIG name value ...]]
[ARGS args [args ...]]
In the new command MODULE LOADEX, client could add some configurable parameters for this module, and update these parameters through command: config set. And finally, client could save these updated command by config rewrite to config file.
However, whatever the MODULE LOAD command or MODULE LOADEX command, we have no way to update the arg. Some module clients do not want to restart the server to use new arg, they want to dynamic update these args during runtime.
So I would like to open this issue to discuss some options to implement this feature:
option 1: Based on my pr #1041, which update the module->loadmod in codes, and then let client run config rewrite, module unload, module load to implement this feature.
option 2: Based on my pr, create a new command module reload = module unload, module load
option 3: Try to create an interface so that ValkeyModule_OnLoad or similar function could access the new module->loadmod
Alternatives you've considered
Any alternative solutions or features you've considered, including references to existing open and closed feature requests in this repository.
Additional information
Any additional information that is relevant to the feature request.
The text was updated successfully, but these errors were encountered:
Module args are sent to the module's own ValkeyClient_OnLoad function (which is like a main() function) which runs only when the module is loaded. This is the only way the args are passed to a module. Therefore, I think it makes sense that args can only be changed when a module is reloaded.
Is it a problem to do MODULE UNLOAD followed by MODULE LOAD, because it is not atomic? Is there is a risk that some user sends a command between these two? If yes, then I prefer option 2, MODULE RELOAD. Maybe we need two variants, just like for MODULE LOAD and LOADEX:
MODULE RELOAD [args...]
MODULE RELOADEX [CONFIG name value [...]] [ARGS args...]
The problem/use-case that the feature addresses
Before Valkey 7, we have command: MODULE LOAD path [arg [arg ...]]
And in Valkey, a new command is added: MODULE LOADEX path [CONFIG name value [CONFIG name value ...]]
[ARGS args [args ...]]
In the new command MODULE LOADEX, client could add some configurable parameters for this module, and update these parameters through command: config set. And finally, client could save these updated command by config rewrite to config file.
However, whatever the MODULE LOAD command or MODULE LOADEX command, we have no way to update the arg. Some module clients do not want to restart the server to use new arg, they want to dynamic update these args during runtime.
So I would like to open this issue to discuss some options to implement this feature:
option 1: Based on my pr #1041, which update the module->loadmod in codes, and then let client run config rewrite, module unload, module load to implement this feature.
option 2: Based on my pr, create a new command module reload = module unload, module load
option 3: Try to create an interface so that ValkeyModule_OnLoad or similar function could access the new module->loadmod
Alternatives you've considered
Any alternative solutions or features you've considered, including references to existing open and closed feature requests in this repository.
Additional information
Any additional information that is relevant to the feature request.
The text was updated successfully, but these errors were encountered: