From 1cd622bdcabf1bd80fd20a7c5722808108e324ff Mon Sep 17 00:00:00 2001 From: YaacovHazan <31382944+YaacovHazan@users.noreply.github.com> Date: Thu, 6 Feb 2025 13:38:07 +0200 Subject: [PATCH] Add an API to load default configuration values (#13788) Currently we have RedisModule_LoadConfigs which the module is expected to call during OnLoad which sets the configuration values from the config queue or it sets the default value. The problem is that the module might still want to support loading values from the command line. If we want to give precedence to the config file values then it means the module needs to set the values before calling the Load Config function. The problem is that then the API overrides the variables which were set from the module command line with default values. The new API should solve that in the following way. 1.Module registers its configuration parameters with redis 2.Module calls RedisModule_LoadDefaultConfigs which loads the default values for all the registered configuration parameters of the module 3.Module sets the variables internally using the values it got from the command line 4.Module calls RedisModule_LoadConfigs which will set the values based on the redis configuration file. This allows for the default values to be set, for the module to override them and for redis to override what the module wrote. In short it determines a logical flow and ordering of where the values for the parameters should come from. The change done by all these previous commits: d9134f8f9 7a40fd630 b9361ad5f 83c034855 f164012c1 98be450f1 0f6e3a827 de4e92ac3 49455c43a c2694fb69 c88f9fe26 855ec46a6 f7353db7e 294492dbf 192799539 a8850a8d3 f35ad8231 a03477349 fd5c32588 Co-authored-by: YaacovHazan