From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) (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 8276F469711 for ; Tue, 9 Jun 2020 15:53:29 +0300 (MSK) Received: by mail-lf1-f66.google.com with SMTP id 202so12414387lfe.5 for ; Tue, 09 Jun 2020 05:53:29 -0700 (PDT) From: Cyrill Gorcunov Date: Tue, 9 Jun 2020 15:53:02 +0300 Message-Id: <20200609125302.279888-3-gorcunov@gmail.com> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 2/2] box: use tnt_raise for quorum check List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml Cc: v.shpilevoy@tarantool.org All other check routines uses tnt_raise so no need to introduce a different approach. Signed-off-by: Cyrill Gorcunov --- src/box/box.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/box/box.cc b/src/box/box.cc index 792c3c394..179feccf6 100644 --- a/src/box/box.cc +++ b/src/box/box.cc @@ -485,9 +485,9 @@ box_check_replication_sync_quorum(void) { int quorum = cfg_geti("replication_sync_quorum"); if (quorum <= 0 || quorum > VCLOCK_MAX) { - diag_set(ClientError, ER_CFG, "replication_sync_quorum", - "the value must be greater than and less than " - "maximal number of replicas"); + tnt_raise(ClientError, ER_CFG, "replication_sync_quorum", + "the value must be greater than and less than " + "maximal number of replicas"); return -1; } return quorum; @@ -675,8 +675,7 @@ box_check_config() box_check_replication_connect_timeout(); box_check_replication_connect_quorum(); box_check_replication_sync_lag(); - if (box_check_replication_sync_quorum() < 0) - diag_raise(); + box_check_replication_sync_quorum(); box_check_replication_sync_timeout(); box_check_readahead(cfg_geti("readahead")); box_check_checkpoint_count(cfg_geti("checkpoint_count")); -- 2.26.2