From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 83BA66C7D2; Thu, 11 Feb 2021 09:51:37 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 83BA66C7D2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1613026297; bh=4pNoXHxiUJDjiZMFLrLw7YCiHR/y8i63oWnYo3l5vBE=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=lNDPd4wTLhDkU2zVnaXPNj4bUkUcjULxDb4TskLhvH4wUfOBivC3vhWS0oZowAJgW CI55tKkXTjU6z2dCXoMt3Xca9e3OnjqWDpIvzYUzDK5x5ghImROel1RpbEd1dtz7AY 4nHi93NbUgRA4BBsR7VJ1hnEDWIlJbnuq+Aw7P70= Received: from smtp63.i.mail.ru (smtp63.i.mail.ru [217.69.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 1C1F86C7D2 for ; Thu, 11 Feb 2021 09:50:53 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1C1F86C7D2 Received: by smtp63.i.mail.ru with esmtpa (envelope-from ) id 1lA5oO-0001pk-U4; Thu, 11 Feb 2021 09:50:49 +0300 To: Vladislav Shpilevoy , tarantool-patches@dev.tarantool.org, yaroslav.dynnikov@tarantool.org References: <150f5ad2684cbeaf3b0aef2fd2a943dcfad23869.1612914070.git.v.shpilevoy@tarantool.org> <7c06b831-923d-4b3d-4f4f-6288b0aa67c0@tarantool.org> <1b189f47-1901-c55f-e103-80222c7730ff@tarantool.org> Message-ID: <2955c6ee-a9ad-4667-b8bc-947ab2f3297a@tarantool.org> Date: Thu, 11 Feb 2021 09:50:48 +0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <1b189f47-1901-c55f-e103-80222c7730ff@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD953AC099BC0052A9C67057FEA5FC82C6F3EDA0BC0B7FA0DC2182A05F5380850404FCEF869E7E9530F43CFDE12803AD4C7E48A65C5E4E5AD72CD705FA65D99989B X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE72F22E6DC541F75D9EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063764345650F0BBEB0B8638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC7BF04B2A11D85FC6924BFC811A81D2D0C751F62243A9DEB7389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C0C26CFBAC0749D213D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8BC908CD1B87A134A2A471835C12D1D977C4224003CC836476EB9C4185024447017B076A6E789B0E975F5C1EE8F4F765FC345195FACC99F9D33AA81AA40904B5D9CF19DD082D7633A078D18283394535A93AA81AA40904B5D98AA50765F79006371260F58ED678537CD81D268191BDAD3D698AB9A7B718F8C442539A7722CA490C13377AFFFEAFD26923F8577A6DFFEA7C02E240F9393C941393EC92FD9297F6715571747095F342E857739F23D657EF2BD5E8D9A59859A8B698B1B85E56A716AC089D37D7C0E48F6C5571747095F342E857739F23D657EF2B6825BDBE14D8E7028C9DFF55498CEFB0BD9CCCA9EDD067B1EDA766A37F9254B7 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A24A6D60772A99906F8E1CD14B953EB46D53828F3CD283DD7D355D89D7DBCDD132 X-C1DE0DAB: 0D63561A33F958A52BA8A800AD9E3D2ADDEE470E889BDFB432C609EE34C47333D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75448CF9D3A7B2C848410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D342C0B628602DFD0BC57E76D69E74EB6A9D009374E95E5A17B209F1E5ED3547A9D3E343C2F14D5264D1D7E09C32AA3244C0A2826D9B65D617100812BE0DAB3C1E17101BF96129E4011FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojmjFTaBTEi1aIOPKsNSTZTA== X-Mailru-Sender: 583F1D7ACE8F49BD9317CE1922F30C7EEC20125C00004011CFB9B7411FD12173326A3B96CD8E65A623E75C7104EB1B885DEE61814008E47C7013064206BFB89F93956FB04BA385BE9437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 6/9] cfg: introduce 'deprecated option' feature X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Oleg Babin via Tarantool-patches Reply-To: Oleg Babin Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Thanks for your fixes. LGTM! On 11/02/2021 01:34, Vladislav Shpilevoy wrote: > Thanks for the review! > > On 10.02.2021 09:59, Oleg Babin wrote: >> Thanks for your patch! >> >> Is it possible to extend log message to "Option is deprecated and has no effect anymore"? > Good idea. See the diff in this commit. > > ==================== > diff --git a/vshard/cfg.lua b/vshard/cfg.lua > index 28c3400..f7d5dbc 100644 > --- a/vshard/cfg.lua > +++ b/vshard/cfg.lua > @@ -61,7 +61,13 @@ local function validate_config(config, template, check_arg) > local expected_type = template_value.type > if template_value.is_deprecated then > if value ~= nil then > - log.warn('Option "%s" is deprecated', name) > + local reason = template_value.reason > + if reason then > + reason = '. '..reason > + else > + reason = '' > + end > + log.warn('Option "%s" is deprecated'..reason, name) > end > elseif value == nil then > if not template_value.is_optional then > ==================== > > And in the next commit: > > ==================== > diff --git a/vshard/cfg.lua b/vshard/cfg.lua > index f7dd4c1..63d5414 100644 > --- a/vshard/cfg.lua > +++ b/vshard/cfg.lua > @@ -252,6 +252,7 @@ local cfg_template = { > }, > collect_bucket_garbage_interval = { > name = 'Garbage bucket collect interval', is_deprecated = true, > + reason = 'Has no effect anymore' > }, > collect_lua_garbage = { > type = 'boolean', name = 'Garbage Lua collect necessity', > > ==================== > >> Also for some options could be useful: "Option is deprecated, use ... instead" (e.g. for "weights"). > With the updated version I can specify any 'reason'. Such as > 'has no affect', 'use ... instead', etc. > >> 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 > Fixed. See the full new patch below. > > ==================== > cfg: introduce 'deprecated option' feature > > Some options in vshard are going to be eventually deprecated. For > instance, 'weights' 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 > > diff --git a/vshard/cfg.lua b/vshard/cfg.lua > index 1ef1899..f7d5dbc 100644 > --- a/vshard/cfg.lua > +++ b/vshard/cfg.lua > @@ -59,7 +59,17 @@ 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 > + local reason = template_value.reason > + if reason then > + reason = '. '..reason > + else > + reason = '' > + end > + log.warn('Option "%s" is deprecated'..reason, name) > + end > + elseif value == nil then > if not template_value.is_optional then > error(string.format('%s must be specified', name)) > else > > ====================