-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide Modules with the ability to reject CONFIG SETs on module configurations #123
Comments
Hello - I am currently implementing a change for this issue and will push out a PR soon |
@KarthikSubbarao - so the use case is to prevent user from EVER changing special config that was defined in module? Or to restrict it config changes to certain values (like ENUM)? Or only enable during configs to be set during start like |
This is meant as a handler for Mutable configs. When they are changed using CONFIG SET, we can benefit from a function that can be executed to decide whether the config should be rejected or not. One example is I have a string config called error-rate:
As part of my validation, I would like to do two things:
If these conditions do not apply, I would like to reject the config set. Similarly, we can have this validation for other config types (integer, enum, bool), etc |
@dmitrypol - I have implemented this functionality here: #144 You can take a look when you get a chance |
Today, Modules using valkeymodule-rs can create configs using the
valkeymodule
macro.Modules can provide a callback that gets triggered on configuration change (after CONFIG SET).
But we do not have a way for Modules to reject CONFIG SET operations on Module configurations.
In Core valkey, we can do this by having the SDK accept a config_set callback, just like we allow modules to provide a on_configuration_change call back. If the Module returns an Error, the config set operation should be rejected. Else, it can be applied.
Current Usage:
The text was updated successfully, but these errors were encountered: