[Tarantool-patches] [PATCH 2/2] box: use tnt_raise for quorum check

Cyrill Gorcunov gorcunov at gmail.com
Tue Jun 9 15:53:02 MSK 2020


All other check routines uses tnt_raise
so no need to introduce a different approach.

Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
 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



More information about the Tarantool-patches mailing list