From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id DE3BF22EDD for ; Mon, 28 May 2018 09:30:32 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6_TyiYt98qlt for ; Mon, 28 May 2018 09:30:32 -0400 (EDT) Received: from smtp56.i.mail.ru (smtp56.i.mail.ru [217.69.128.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 996C422DFD for ; Mon, 28 May 2018 09:30:32 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH] Don't raise on box.cfg for instance_uuid and replicaset_uuid References: <35328a1dcd8edadbbeda7286b7e9b8024e98adc9.1527511892.git.georgy@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Mon, 28 May 2018 16:30:27 +0300 MIME-Version: 1.0 In-Reply-To: <35328a1dcd8edadbbeda7286b7e9b8024e98adc9.1527511892.git.georgy@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org, Georgy Kirichenko Hello. Thanks for the patch! See my 3 comments below. 1. Please, send a patch copy to ones who might review it. On 28/05/2018 15:53, Georgy Kirichenko wrote: > Handle cases if instance_uuid and replicaset_uuid are present in > box.cfg and have same values as already set. > > Fixes #3421 > --- > Branch: https://github.com/tarantool/tarantool/tree/gh-3421-box-cfg-instance-uuid > Issue: https://github.com/tarantool/tarantool/issues/3421 > src/box/lua/load_cfg.lua | 14 ++++++++++++++ > test/box/cfg.result | 15 +++++++++++++++ > test/box/cfg.test.lua | 6 ++++++ > 3 files changed, 35 insertions(+) > > diff --git a/src/box/lua/load_cfg.lua b/src/box/lua/load_cfg.lua > index d4f2128db..142c1bd04 100644 > --- a/src/box/lua/load_cfg.lua > +++ b/src/box/lua/load_cfg.lua > @@ -183,6 +183,18 @@ local dynamic_cfg = { > force_recovery = function() end, > replication_timeout = private.cfg_set_replication_timeout, > replication_connect_quorum = private.cfg_set_replication_connect_quorum, > + instance_uuid = function() > + if box.cfg.instance_uuid ~= box.info.uuid then > + box.error(box.error.CFG, 'instance_uuid', > + 'Can\'t change instance uuid') > + end > + end, > + replicaset_uuid = function(new_value) > + if box.cfg.replicaset_uuid ~= box.info.cluster.uuid then > + box.error(box.error.CFG, 'replicaset_uuid', > + 'Can\'t change replicaset uuid') > + end > + end, 2. Please, use box.error.RELOAD_CFG like it is done for all non-dynamic options. > } > > local dynamic_cfg_skip_at_load = { > @@ -194,6 +206,8 @@ local dynamic_cfg_skip_at_load = { > wal_dir_rescan_delay = true, > custom_proc_title = true, > force_recovery = true, > + instance_uuid = true, > + replicaset_uuid = true, 3. Why?