Tarantool development patches archive
 help / color / mirror / Atom feed
* [tarantool-patches] [PATCH] box: allow vinyl_memory set to 0 in config
@ 2018-07-04 11:36 Serge Petrenko
  2018-07-04 12:02 ` Vladimir Davydov
  0 siblings, 1 reply; 3+ messages in thread
From: Serge Petrenko @ 2018-07-04 11:36 UTC (permalink / raw)
  To: tarantool-patches; +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)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [tarantool-patches] [PATCH] box: allow vinyl_memory set to 0 in config
  2018-07-04 11:36 [tarantool-patches] [PATCH] box: allow vinyl_memory set to 0 in config Serge Petrenko
@ 2018-07-04 12:02 ` Vladimir Davydov
  2018-07-04 12:56   ` Sergey Petrenko
  0 siblings, 1 reply; 3+ messages in thread
From: Vladimir Davydov @ 2018-07-04 12:02 UTC (permalink / raw)
  To: Serge Petrenko; +Cc: tarantool-patches

On Wed, Jul 04, 2018 at 02:36:34PM +0300, Serge Petrenko wrote:
> 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(-)

Please add a test case checking that box.cfg.vinyl_memory can actually
be set to 0. Other than that looks OK.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [tarantool-patches] [PATCH] box: allow vinyl_memory set to 0 in config
  2018-07-04 12:02 ` Vladimir Davydov
@ 2018-07-04 12:56   ` Sergey Petrenko
  0 siblings, 0 replies; 3+ messages in thread
From: Sergey Petrenko @ 2018-07-04 12:56 UTC (permalink / raw)
  To: Vladimir Davydov; +Cc: tarantool-patches

04.07.2018 15:02, Vladimir Davydov пишет:
> On Wed, Jul 04, 2018 at 02:36:34PM +0300, Serge Petrenko wrote:
>> 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(-)
> Please add a test case checking that box.cfg.vinyl_memory can actually
> be set to 0. Other than that looks OK.
Added a test case. Thankyou for the review.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-04 12:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-04 11:36 [tarantool-patches] [PATCH] box: allow vinyl_memory set to 0 in config Serge Petrenko
2018-07-04 12:02 ` Vladimir Davydov
2018-07-04 12:56   ` Sergey Petrenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox