[Tarantool-patches] [PATCH 6/9] cfg: introduce 'deprecated option' feature
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Wed Feb 10 02:46:12 MSK 2021
Some options in vshard are going to be eventually deprecated. For
instance, 'weigts' will be renamed, 'collect_lua_garbage' may be
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
--
2.24.3 (Apple Git-128)
More information about the Tarantool-patches
mailing list