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 24F1A267D2 for ; Wed, 4 Jul 2018 07:36:50 -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 gMgD21Xtzmpy for ; Wed, 4 Jul 2018 07:36:50 -0400 (EDT) Received: from smtp61.i.mail.ru (smtp61.i.mail.ru [217.69.128.41]) (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 D9B07267CC for ; Wed, 4 Jul 2018 07:36:49 -0400 (EDT) From: Serge Petrenko Subject: [tarantool-patches] [PATCH] box: allow vinyl_memory set to 0 in config Date: Wed, 4 Jul 2018 14:36:34 +0300 Message-Id: <20180704113634.71324-1-sergepetrenko@tarantool.org> 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 Cc: Serge Petrenko In 1.9 it was possible to have a vinylless configuration with vinyl_memory=0, allow to do this in 1.10 by adjusting sanity checks for vinyl_memory and memtx_memory. Now banning only negative values. memtx_memory check was changed for consistency, trying to set memtx_memory to 0 fails anyways. Closes: #3468 --- https://github.com/tarantool/tarantool/compare/sergepetrenko/gh-3468-allow-0-vinyl-memory https://github.com/tarantool/tarantool/issues/3468 src/box/box.cc | 8 ++++---- test/box/cfg.result | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/box/box.cc b/src/box/box.cc index dcbf52e10..7d6dfc8f6 100644 --- a/src/box/box.cc +++ b/src/box/box.cc @@ -495,9 +495,9 @@ box_check_wal_max_size(int64_t wal_max_size) static int64_t box_check_memtx_memory(int64_t memory) { - if (memory <= 0) { + if (memory < 0) { tnt_raise(ClientError, ER_CFG, "memtx_memory", - "must be greater than 0"); + "must not be less than 0"); } return memory; } @@ -505,9 +505,9 @@ box_check_memtx_memory(int64_t memory) static int64_t box_check_vinyl_memory(int64_t memory) { - if (memory <= 0) { + if (memory < 0) { tnt_raise(ClientError, ER_CFG, "vinyl_memory", - "must be greater than 0"); + "must not be less than 0"); } return memory; } diff --git a/test/box/cfg.result b/test/box/cfg.result index 7604f61dc..6debb564b 100644 --- a/test/box/cfg.result +++ b/test/box/cfg.result @@ -240,11 +240,11 @@ box.cfg{memtx_memory = "100500"} ... box.cfg{memtx_memory = -1} --- -- error: 'Incorrect value for option ''memtx_memory'': must be greater than 0' +- error: 'Incorrect value for option ''memtx_memory'': must not be less than 0' ... box.cfg{vinyl_memory = -1} --- -- error: 'Incorrect value for option ''vinyl_memory'': must be greater than 0' +- error: 'Incorrect value for option ''vinyl_memory'': must not be less than 0' ... box.cfg{vinyl = "vinyl"} --- -- 2.15.2 (Apple Git-101.1)