From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id C7A5D45C304 for ; Sun, 20 Dec 2020 21:28:43 +0300 (MSK) Received: by mail-lf1-f48.google.com with SMTP id h22so8888204lfu.2 for ; Sun, 20 Dec 2020 10:28:43 -0800 (PST) Date: Sun, 20 Dec 2020 21:28:41 +0300 From: Cyrill Gorcunov Message-ID: <20201220182841.GF3139@grain> References: <20201214113935.1040421-1-gorcunov@gmail.com> <20201214113935.1040421-3-gorcunov@gmail.com> <20201218072529.GF14556@grain> <47af00c0-5f40-533c-f51c-84d16c609c11@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47af00c0-5f40-533c-f51c-84d16c609c11@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v4 2/3] cfg: support symbolic evaluation of replication_synchro_quorum List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: Mons Anderson , tml On Sun, Dec 20, 2020 at 06:01:25PM +0100, Vladislav Shpilevoy wrote: ... > > I saw the comment and I understood it. But it does not mean the function > can now return random values. It does not matter if you return 0 or 1 or > whatever else. It still can't be used for anything useful except check < 0. > > That makes the function result confusing and even useless. > > Previously quorum value was returned *and used as quorum value*. Now it > is used only for < 0 check. Hence, why do you need to return anything > except -1 and 0? > > For example, look at box_check_replication_synchro_timeout(). It returns > *timeout value*, which is used to set replication_synchro_timeout. > > box_set_replication_synchro_quorum() before your patch did the same > with box_check_replication_synchro_quorum(). Now it uses check() result > only to compare it with < 0, which is *confusing* - why would it need > to return anything but -1 and 0 then? > > Here is what I want to see: Aha, I see what you mean. I think we should split then. - change existing code to return 0|-1 - then introduce new code this allows us to see the changes more clearly