[Tarantool-patches] [PATCH 6/9] cfg: introduce 'deprecated option' feature

Oleg Babin olegrok at tarantool.org
Wed Feb 10 11:59:14 MSK 2021


Thanks for your patch!

Is it possible to extend log message to "Option is deprecated and has no 
effect anymore"?

Also for some options could be useful: "Option is deprecated, use ... 
instead" (e.g. for "weights").

Seems it should be more configurable and gives some hint for user to do.


On 10/02/2021 02:46, Vladislav Shpilevoy wrote:
> Some options in vshard are going to be eventually deprecated. For
> instance, 'weigts' will be renamed, 'collect_lua_garbage' may be


typo: weigts -> weights


> deleted since it appears not to be so useful, 'sync_timeout' is
> totally unnecessary since any 'sync' can take a timeout per-call.
>
> But the patch is motivated by 'collect_bucket_garbage_interval'
> which is going to become unused in the new GC algorithm.
>
> New GC will be reactive instead of proactive. Instead of periodic
> polling of _bucket space it will react on needed events
> immediately. This will make the 'collect interval' unused.
>
> The option will be deprecated and eventually in some far future
> release its usage will lead to an error.
>
> Needed for #147
> ---
>   vshard/cfg.lua | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/vshard/cfg.lua b/vshard/cfg.lua
> index 1ef1899..28c3400 100644
> --- a/vshard/cfg.lua
> +++ b/vshard/cfg.lua
> @@ -59,7 +59,11 @@ local function validate_config(config, template, check_arg)
>           local value = config[key]
>           local name = template_value.name
>           local expected_type = template_value.type
> -        if value == nil then
> +        if template_value.is_deprecated then
> +            if value ~= nil then
> +                log.warn('Option "%s" is deprecated', name)
> +            end
> +        elseif value == nil then
>               if not template_value.is_optional then
>                   error(string.format('%s must be specified', name))
>               else


More information about the Tarantool-patches mailing list