From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Vladimir Davydov Subject: [PATCH 1/2] Move box.info.vinyl to box.stat.vinyl Date: Thu, 31 May 2018 20:13:46 +0300 Message-Id: In-Reply-To: References: In-Reply-To: References: To: kostja@tarantool.org Cc: tarantool-patches@freelists.org List-ID: All global statistics are meant to be in box.stat module so let's move box.info.vinyl to box.stat.vinyl, but leave the old alias - we will remove it in 2.0. Patch all tests to use the new alias. Closes #3277 --- src/box/lua/info.c | 2 +- src/box/lua/stat.c | 22 +++++++++++++++++++++- src/box/vinyl.c | 2 +- src/box/vinyl.h | 4 ++-- test/vinyl/cache.result | 8 ++++---- test/vinyl/cache.test.lua | 8 ++++---- test/vinyl/info.result | 2 +- test/vinyl/info.test.lua | 2 +- test/vinyl/misc.result | 4 ++-- test/vinyl/misc.test.lua | 4 ++-- test/vinyl/mvcc.result | 34 +++++++++++++++++----------------- test/vinyl/mvcc.test.lua | 34 +++++++++++++++++----------------- test/vinyl/quota.result | 26 +++++++++++++------------- test/vinyl/quota.test.lua | 26 +++++++++++++------------- test/vinyl/quota_timeout.result | 6 +++--- test/vinyl/quota_timeout.test.lua | 6 +++--- test/vinyl/recovery_quota.result | 6 +++--- test/vinyl/recovery_quota.test.lua | 6 +++--- test/vinyl/tx_gap_lock.result | 2 +- test/vinyl/tx_gap_lock.test.lua | 2 +- test/vinyl/upgrade/fill.lua | 2 +- 21 files changed, 114 insertions(+), 94 deletions(-) diff --git a/src/box/lua/info.c b/src/box/lua/info.c index 7dc2b83a..2dd6e770 100644 --- a/src/box/lua/info.c +++ b/src/box/lua/info.c @@ -434,7 +434,7 @@ lbox_info_vinyl_call(struct lua_State *L) struct vinyl_engine *vinyl; vinyl = (struct vinyl_engine *)engine_by_name("vinyl"); assert(vinyl != NULL); - vinyl_engine_info(vinyl, &h); + vinyl_engine_stat(vinyl, &h); return 1; } diff --git a/src/box/lua/stat.c b/src/box/lua/stat.c index 0e60036a..83a5b64e 100644 --- a/src/box/lua/stat.c +++ b/src/box/lua/stat.c @@ -40,6 +40,10 @@ #include "box/box.h" #include "box/iproto.h" +#include "box/engine.h" +#include "box/vinyl.h" +#include "box/info.h" +#include "box/lua/info.h" #include "lua/utils.h" extern struct rmean *rmean_box; @@ -112,6 +116,18 @@ lbox_stat_call(struct lua_State *L) } static int +lbox_stat_vinyl(struct lua_State *L) +{ + struct info_handler h; + luaT_info_handler_create(&h, L); + struct vinyl_engine *vinyl; + vinyl = (struct vinyl_engine *)engine_by_name("vinyl"); + assert(vinyl != NULL); + vinyl_engine_stat(vinyl, &h); + return 1; +} + +static int lbox_stat_reset(struct lua_State *L) { (void)L; @@ -152,6 +168,7 @@ void box_lua_stat_init(struct lua_State *L) { static const struct luaL_Reg statlib [] = { + {"vinyl", lbox_stat_vinyl}, {"reset", lbox_stat_reset}, {NULL, NULL} }; @@ -163,8 +180,11 @@ box_lua_stat_init(struct lua_State *L) lua_setmetatable(L, -2); lua_pop(L, 1); /* stat module */ + static const struct luaL_Reg netstatlib [] = { + {NULL, NULL} + }; - luaL_register_module(L, "box.stat.net", statlib); + luaL_register_module(L, "box.stat.net", netstatlib); lua_newtable(L); luaL_register(L, NULL, lbox_stat_net_meta); diff --git a/src/box/vinyl.c b/src/box/vinyl.c index 3f545fab..390a1f66 100644 --- a/src/box/vinyl.c +++ b/src/box/vinyl.c @@ -347,7 +347,7 @@ vy_info_append_tx(struct vy_env *env, struct info_handler *h) } void -vinyl_engine_info(struct vinyl_engine *vinyl, struct info_handler *h) +vinyl_engine_stat(struct vinyl_engine *vinyl, struct info_handler *h) { struct vy_env *env = vinyl->env; diff --git a/src/box/vinyl.h b/src/box/vinyl.h index 4e9f91f0..ff07c249 100644 --- a/src/box/vinyl.h +++ b/src/box/vinyl.h @@ -46,10 +46,10 @@ vinyl_engine_new(const char *dir, size_t memory, int read_threads, int write_threads, bool force_recovery); /** - * Engine introspection (box.info.vinyl()) + * Vinyl engine statistics (box.stat.vinyl()). */ void -vinyl_engine_info(struct vinyl_engine *vinyl, struct info_handler *handler); +vinyl_engine_stat(struct vinyl_engine *vinyl, struct info_handler *handler); /** * Update vinyl cache size. diff --git a/test/vinyl/cache.result b/test/vinyl/cache.result index 3ec28a12..108b8c1c 100644 --- a/test/vinyl/cache.result +++ b/test/vinyl/cache.result @@ -1031,21 +1031,21 @@ for i = 1, 100 do s:replace{i, string.rep('x', 1000)} end for i = 1, 100 do s:get{i} end --- ... -box.info.vinyl().cache.used +box.stat.vinyl().cache.used --- - 107700 ... box.cfg{vinyl_cache = 50 * 1000} --- ... -box.info.vinyl().cache.used +box.stat.vinyl().cache.used --- - 49542 ... box.cfg{vinyl_cache = 0} --- ... -box.info.vinyl().cache.used +box.stat.vinyl().cache.used --- - 0 ... @@ -1067,7 +1067,7 @@ st2.put.rows - st1.put.rows --- - 0 ... -box.info.vinyl().cache.used +box.stat.vinyl().cache.used --- - 0 ... diff --git a/test/vinyl/cache.test.lua b/test/vinyl/cache.test.lua index 2d56152b..b9eac75b 100644 --- a/test/vinyl/cache.test.lua +++ b/test/vinyl/cache.test.lua @@ -366,17 +366,17 @@ s = box.schema.space.create('test', {engine = 'vinyl'}) _ = s:create_index('pk') for i = 1, 100 do s:replace{i, string.rep('x', 1000)} end for i = 1, 100 do s:get{i} end -box.info.vinyl().cache.used +box.stat.vinyl().cache.used box.cfg{vinyl_cache = 50 * 1000} -box.info.vinyl().cache.used +box.stat.vinyl().cache.used box.cfg{vinyl_cache = 0} -box.info.vinyl().cache.used +box.stat.vinyl().cache.used -- Make sure cache is not populated if box.cfg.vinyl_cache is set to 0 st1 = s.index.pk:info().cache #s:select() for i = 1, 100 do s:get{i} end st2 = s.index.pk:info().cache st2.put.rows - st1.put.rows -box.info.vinyl().cache.used +box.stat.vinyl().cache.used s:drop() box.cfg{vinyl_cache = vinyl_cache} diff --git a/test/vinyl/info.result b/test/vinyl/info.result index eda6ae89..9ca1027a 100644 --- a/test/vinyl/info.result +++ b/test/vinyl/info.result @@ -98,7 +98,7 @@ end; -- Note, quota watermark checking is beyond the scope of this -- test so we just filter out related statistics. function gstat() - local st = box.info.vinyl() + local st = box.stat.vinyl() st.quota.use_rate = nil st.quota.dump_bandwidth = nil st.quota.watermark = nil diff --git a/test/vinyl/info.test.lua b/test/vinyl/info.test.lua index 60b69ee2..d5988c87 100644 --- a/test/vinyl/info.test.lua +++ b/test/vinyl/info.test.lua @@ -80,7 +80,7 @@ end; -- Note, quota watermark checking is beyond the scope of this -- test so we just filter out related statistics. function gstat() - local st = box.info.vinyl() + local st = box.stat.vinyl() st.quota.use_rate = nil st.quota.dump_bandwidth = nil st.quota.watermark = nil diff --git a/test/vinyl/misc.result b/test/vinyl/misc.result index 8c4bbbb4..ecdcf818 100644 --- a/test/vinyl/misc.result +++ b/test/vinyl/misc.result @@ -85,7 +85,7 @@ s = box.schema.create_space('test', { engine = 'vinyl' }) _ = s:create_index('pk') --- ... -tx1 = box.info.vinyl().tx +tx1 = box.stat.vinyl().tx --- ... ch = fiber.channel(1) @@ -98,7 +98,7 @@ ch:get() --- - true ... -tx2 = box.info.vinyl().tx +tx2 = box.stat.vinyl().tx --- ... tx2.commit - tx1.commit -- 0 diff --git a/test/vinyl/misc.test.lua b/test/vinyl/misc.test.lua index 93dfb4bf..9442a29d 100644 --- a/test/vinyl/misc.test.lua +++ b/test/vinyl/misc.test.lua @@ -40,11 +40,11 @@ s:drop() -- s = box.schema.create_space('test', { engine = 'vinyl' }) _ = s:create_index('pk') -tx1 = box.info.vinyl().tx +tx1 = box.stat.vinyl().tx ch = fiber.channel(1) _ = fiber.create(function() box.begin() s:insert{1} ch:put(true) end) ch:get() -tx2 = box.info.vinyl().tx +tx2 = box.stat.vinyl().tx tx2.commit - tx1.commit -- 0 tx2.rollback - tx1.rollback -- 1 s:drop() diff --git a/test/vinyl/mvcc.result b/test/vinyl/mvcc.result index be10f2d6..1941744b 100644 --- a/test/vinyl/mvcc.result +++ b/test/vinyl/mvcc.result @@ -1,7 +1,7 @@ test_run = require('test_run').new() --- ... --- need to restart in order to reset box.info.vinyl() stats +-- need to restart in order to reset box.stat.vinyl() stats test_run:cmd("restart server default") txn_proxy = require('txn_proxy') --- @@ -4012,11 +4012,11 @@ s:replace{7, 8, 9} --- - [7, 8, 9] ... -box.info.vinyl().tx.read_views -- 0 (no read views needed) +box.stat.vinyl().tx.read_views -- 0 (no read views needed) --- - 0 ... -box.info.vinyl().tx.transactions -- 0 +box.stat.vinyl().tx.transactions -- 0 --- - 0 ... @@ -4048,11 +4048,11 @@ c4:begin() --- - ... -box.info.vinyl().tx.read_views -- 0 (no read views needed) +box.stat.vinyl().tx.read_views -- 0 (no read views needed) --- - 0 ... -box.info.vinyl().tx.transactions -- 0 +box.stat.vinyl().tx.transactions -- 0 --- - 0 ... @@ -4072,11 +4072,11 @@ c4("s:select{1}") --- - - [[1, 2, 3]] ... -box.info.vinyl().tx.read_views -- 0 (no read views needed) +box.stat.vinyl().tx.read_views -- 0 (no read views needed) --- - 0 ... -box.info.vinyl().tx.transactions -- 4 +box.stat.vinyl().tx.transactions -- 4 --- - 4 ... @@ -4084,11 +4084,11 @@ c4("s:replace{1, 0, 0}") --- - - [1, 0, 0] ... -box.info.vinyl().tx.read_views -- 0 (no read views needed) +box.stat.vinyl().tx.read_views -- 0 (no read views needed) --- - 0 ... -box.info.vinyl().tx.transactions -- 4 +box.stat.vinyl().tx.transactions -- 4 --- - 4 ... @@ -4096,11 +4096,11 @@ c4:commit() --- - ... -box.info.vinyl().tx.read_views -- 1 (one read view for all TXs) +box.stat.vinyl().tx.read_views -- 1 (one read view for all TXs) --- - 1 ... -box.info.vinyl().tx.transactions -- 3 +box.stat.vinyl().tx.transactions -- 3 --- - 3 ... @@ -4108,11 +4108,11 @@ c1:commit() --- - ... -box.info.vinyl().tx.read_views -- 1 (one read view for all TXs) +box.stat.vinyl().tx.read_views -- 1 (one read view for all TXs) --- - 1 ... -box.info.vinyl().tx.transactions -- 2 +box.stat.vinyl().tx.transactions -- 2 --- - 2 ... @@ -4120,11 +4120,11 @@ c2:rollback() --- - ... -box.info.vinyl().tx.read_views -- 1 (one read view for all TXs) +box.stat.vinyl().tx.read_views -- 1 (one read view for all TXs) --- - 1 ... -box.info.vinyl().tx.transactions -- 1 +box.stat.vinyl().tx.transactions -- 1 --- - 1 ... @@ -4132,11 +4132,11 @@ c3:commit() --- - ... -box.info.vinyl().tx.read_views -- 0 (no read views needed) +box.stat.vinyl().tx.read_views -- 0 (no read views needed) --- - 0 ... -box.info.vinyl().tx.transactions -- 0 (all done) +box.stat.vinyl().tx.transactions -- 0 (all done) --- - 0 ... diff --git a/test/vinyl/mvcc.test.lua b/test/vinyl/mvcc.test.lua index 5f30c7cc..79b1f342 100644 --- a/test/vinyl/mvcc.test.lua +++ b/test/vinyl/mvcc.test.lua @@ -1,5 +1,5 @@ test_run = require('test_run').new() --- need to restart in order to reset box.info.vinyl() stats +-- need to restart in order to reset box.stat.vinyl() stats test_run:cmd("restart server default") txn_proxy = require('txn_proxy') @@ -1587,8 +1587,8 @@ s:replace{1, 2, 3} s:replace{4, 5, 6} s:replace{7, 8, 9} -box.info.vinyl().tx.read_views -- 0 (no read views needed) -box.info.vinyl().tx.transactions -- 0 +box.stat.vinyl().tx.read_views -- 0 (no read views needed) +box.stat.vinyl().tx.transactions -- 0 c1 = txn_proxy.new() c2 = txn_proxy.new() @@ -1600,40 +1600,40 @@ c2:begin() c3:begin() c4:begin() -box.info.vinyl().tx.read_views -- 0 (no read views needed) -box.info.vinyl().tx.transactions -- 0 +box.stat.vinyl().tx.read_views -- 0 (no read views needed) +box.stat.vinyl().tx.transactions -- 0 c1("s:select{1}") c2("s:select{1}") c3("s:select{1}") c4("s:select{1}") -box.info.vinyl().tx.read_views -- 0 (no read views needed) -box.info.vinyl().tx.transactions -- 4 +box.stat.vinyl().tx.read_views -- 0 (no read views needed) +box.stat.vinyl().tx.transactions -- 4 c4("s:replace{1, 0, 0}") -box.info.vinyl().tx.read_views -- 0 (no read views needed) -box.info.vinyl().tx.transactions -- 4 +box.stat.vinyl().tx.read_views -- 0 (no read views needed) +box.stat.vinyl().tx.transactions -- 4 c4:commit() -box.info.vinyl().tx.read_views -- 1 (one read view for all TXs) -box.info.vinyl().tx.transactions -- 3 +box.stat.vinyl().tx.read_views -- 1 (one read view for all TXs) +box.stat.vinyl().tx.transactions -- 3 c1:commit() -box.info.vinyl().tx.read_views -- 1 (one read view for all TXs) -box.info.vinyl().tx.transactions -- 2 +box.stat.vinyl().tx.read_views -- 1 (one read view for all TXs) +box.stat.vinyl().tx.transactions -- 2 c2:rollback() -box.info.vinyl().tx.read_views -- 1 (one read view for all TXs) -box.info.vinyl().tx.transactions -- 1 +box.stat.vinyl().tx.read_views -- 1 (one read view for all TXs) +box.stat.vinyl().tx.transactions -- 1 c3:commit() -box.info.vinyl().tx.read_views -- 0 (no read views needed) -box.info.vinyl().tx.transactions -- 0 (all done) +box.stat.vinyl().tx.read_views -- 0 (no read views needed) +box.stat.vinyl().tx.transactions -- 0 (all done) s:drop() diff --git a/test/vinyl/quota.result b/test/vinyl/quota.result index 359efe8b..e323bc4e 100644 --- a/test/vinyl/quota.result +++ b/test/vinyl/quota.result @@ -12,7 +12,7 @@ test_run:cmd('restart server default') -- -- gh-1863 add BPS tree extents to memory quota -- -box.info.vinyl().quota.used +box.stat.vinyl().quota.used --- - 0 ... @@ -29,7 +29,7 @@ space:insert({1, 1}) --- - [1, 1] ... -box.info.vinyl().quota.used +box.stat.vinyl().quota.used --- - 98343 ... @@ -37,7 +37,7 @@ space:insert({1, 1}) --- - error: Duplicate key exists in unique index 'pk' in space 'test' ... -box.info.vinyl().quota.used +box.stat.vinyl().quota.used --- - 98343 ... @@ -45,7 +45,7 @@ space:update({1}, {{'!', 1, 100}}) -- try to modify the primary key --- - error: Attempt to modify a tuple field which is part of index 'pk' in space 'test' ... -box.info.vinyl().quota.used +box.stat.vinyl().quota.used --- - 98343 ... @@ -61,7 +61,7 @@ space:insert({4, 4}) --- - [4, 4] ... -box.info.vinyl().quota.used +box.stat.vinyl().quota.used --- - 98460 ... @@ -69,7 +69,7 @@ box.snapshot() --- - ok ... -box.info.vinyl().quota.used +box.stat.vinyl().quota.used --- - 0 ... @@ -80,14 +80,14 @@ space:select{} - [3, 3] - [4, 4] ... -box.info.vinyl().quota.used +box.stat.vinyl().quota.used --- - 0 ... _ = space:replace{1, 1, string.rep('a', 1024 * 1024 * 5)} --- ... -box.info.vinyl().quota.used +box.stat.vinyl().quota.used --- - 5341228 ... @@ -121,14 +121,14 @@ count = 20 pad = string.rep('x', 100 * 1024) --- ... -box.info.vinyl().quota.limit +box.stat.vinyl().quota.limit --- - 1048576 ... for i = 1, count do s:replace{i, pad} end -- triggers dump --- ... -box.info.vinyl().quota.used < count * pad:len() +box.stat.vinyl().quota.used < count * pad:len() --- - true ... @@ -139,14 +139,14 @@ box.snapshot() box.cfg{vinyl_memory = 8 * 1024 * 1024} --- ... -box.info.vinyl().quota.limit +box.stat.vinyl().quota.limit --- - 8388608 ... for i = 1, count do s:replace{i, pad} end -- does not trigger dump --- ... -box.info.vinyl().quota.used > count * pad:len() +box.stat.vinyl().quota.used > count * pad:len() --- - true ... @@ -155,7 +155,7 @@ box.cfg{vinyl_memory = 4 * 1024 * 1024} -- error: decreasing vinyl_memory is not - error: 'Incorrect value for option ''vinyl_memory'': cannot decrease memory size at runtime' ... -box.info.vinyl().quota.limit +box.stat.vinyl().quota.limit --- - 8388608 ... diff --git a/test/vinyl/quota.test.lua b/test/vinyl/quota.test.lua index 7f7b4ec3..e67e5430 100644 --- a/test/vinyl/quota.test.lua +++ b/test/vinyl/quota.test.lua @@ -12,7 +12,7 @@ test_run:cmd('restart server default') -- gh-1863 add BPS tree extents to memory quota -- -box.info.vinyl().quota.used +box.stat.vinyl().quota.used space = box.schema.space.create('test', { engine = 'vinyl' }) pk = space:create_index('pk') @@ -20,33 +20,33 @@ sec = space:create_index('sec', { parts = {2, 'unsigned'} }) space:insert({1, 1}) -box.info.vinyl().quota.used +box.stat.vinyl().quota.used space:insert({1, 1}) -box.info.vinyl().quota.used +box.stat.vinyl().quota.used space:update({1}, {{'!', 1, 100}}) -- try to modify the primary key -box.info.vinyl().quota.used +box.stat.vinyl().quota.used space:insert({2, 2}) space:insert({3, 3}) space:insert({4, 4}) -box.info.vinyl().quota.used +box.stat.vinyl().quota.used box.snapshot() -box.info.vinyl().quota.used +box.stat.vinyl().quota.used space:select{} -box.info.vinyl().quota.used +box.stat.vinyl().quota.used _ = space:replace{1, 1, string.rep('a', 1024 * 1024 * 5)} -box.info.vinyl().quota.used +box.stat.vinyl().quota.used space:drop() @@ -63,21 +63,21 @@ _ = s:create_index('pk') count = 20 pad = string.rep('x', 100 * 1024) -box.info.vinyl().quota.limit +box.stat.vinyl().quota.limit for i = 1, count do s:replace{i, pad} end -- triggers dump -box.info.vinyl().quota.used < count * pad:len() +box.stat.vinyl().quota.used < count * pad:len() box.snapshot() box.cfg{vinyl_memory = 8 * 1024 * 1024} -box.info.vinyl().quota.limit +box.stat.vinyl().quota.limit for i = 1, count do s:replace{i, pad} end -- does not trigger dump -box.info.vinyl().quota.used > count * pad:len() +box.stat.vinyl().quota.used > count * pad:len() box.cfg{vinyl_memory = 4 * 1024 * 1024} -- error: decreasing vinyl_memory is not allowed -box.info.vinyl().quota.limit +box.stat.vinyl().quota.limit test_run:cmd('switch default') test_run:cmd("stop server test") diff --git a/test/vinyl/quota_timeout.result b/test/vinyl/quota_timeout.result index e977fb52..b0c36c86 100644 --- a/test/vinyl/quota_timeout.result +++ b/test/vinyl/quota_timeout.result @@ -47,7 +47,7 @@ s:count() --- - 1 ... -box.info.vinyl().quota.used +box.stat.vinyl().quota.used --- - 748241 ... @@ -61,7 +61,7 @@ s:count() --- - 1 ... -box.info.vinyl().quota.used +box.stat.vinyl().quota.used --- - 748241 ... @@ -148,7 +148,7 @@ box.snapshot() -- The following operation should fail instantly irrespective -- of the value of 'vinyl_timeout' (gh-3291). -- -box.info.vinyl().quota.used == 0 +box.stat.vinyl().quota.used == 0 --- - true ... diff --git a/test/vinyl/quota_timeout.test.lua b/test/vinyl/quota_timeout.test.lua index 6ea6d677..14ac042f 100644 --- a/test/vinyl/quota_timeout.test.lua +++ b/test/vinyl/quota_timeout.test.lua @@ -21,13 +21,13 @@ _ = s:create_index('pk') pad = string.rep('x', 2 * box.cfg.vinyl_memory / 3) _ = s:auto_increment{pad} s:count() -box.info.vinyl().quota.used +box.stat.vinyl().quota.used -- Since the following operation requires more memory than configured -- and dump is disabled, it should fail with ER_VY_QUOTA_TIMEOUT. _ = s:auto_increment{pad} s:count() -box.info.vinyl().quota.used +box.stat.vinyl().quota.used -- -- Check that increasing box.cfg.vinyl_memory wakes up fibers @@ -72,7 +72,7 @@ box.snapshot() -- The following operation should fail instantly irrespective -- of the value of 'vinyl_timeout' (gh-3291). -- -box.info.vinyl().quota.used == 0 +box.stat.vinyl().quota.used == 0 box.cfg{vinyl_timeout = 9000} pad = string.rep('x', box.cfg.vinyl_memory) _ = s:auto_increment{pad} diff --git a/test/vinyl/recovery_quota.result b/test/vinyl/recovery_quota.result index 46769c4c..68cd9248 100644 --- a/test/vinyl/recovery_quota.result +++ b/test/vinyl/recovery_quota.result @@ -57,7 +57,7 @@ _ = var:insert{'dump', stat.disk.dump.out.rows} ... test_run:cmd('restart server test with args="2097152"') -- Check that we do not exceed quota. -stat = box.info.vinyl() +stat = box.stat.vinyl() --- ... stat.quota.used <= stat.quota.limit or {stat.quota.used, stat.quota.limit} @@ -109,7 +109,7 @@ for i = 1, box.cfg.vinyl_memory / pad_size do box.space.test:replace{i, pad} end --- - error: Timed out waiting for Vinyl memory quota ... -box.info.vinyl().quota.used > 1024 * 1024 +box.stat.vinyl().quota.used > 1024 * 1024 --- - true ... @@ -122,7 +122,7 @@ fiber = require 'fiber' while box.space.test.index.pk:info().disk.dump.count == 0 do fiber.sleep(0.001) end --- ... -stat = box.info.vinyl() +stat = box.stat.vinyl() --- ... stat.quota.used <= stat.quota.limit or {stat.quota.used, stat.quota.limit} diff --git a/test/vinyl/recovery_quota.test.lua b/test/vinyl/recovery_quota.test.lua index c2462078..ec571a09 100644 --- a/test/vinyl/recovery_quota.test.lua +++ b/test/vinyl/recovery_quota.test.lua @@ -26,7 +26,7 @@ _ = var:insert{'put', stat.put.rows} _ = var:insert{'dump', stat.disk.dump.out.rows} test_run:cmd('restart server test with args="2097152"') -- Check that we do not exceed quota. -stat = box.info.vinyl() +stat = box.stat.vinyl() stat.quota.used <= stat.quota.limit or {stat.quota.used, stat.quota.limit} -- Check that we did not replay statements dumped before restart. stat = box.space.test.index.pk:info() @@ -43,13 +43,13 @@ box.cfg{vinyl_timeout=0.001} pad_size = 1000 pad = string.rep('x', pad_size) for i = 1, box.cfg.vinyl_memory / pad_size do box.space.test:replace{i, pad} end -box.info.vinyl().quota.used > 1024 * 1024 +box.stat.vinyl().quota.used > 1024 * 1024 -- Check that tarantool can recover with a smaller memory limit. test_run:cmd('restart server test with args="1048576"') fiber = require 'fiber' -- All memory above the limit must be dumped after recovery. while box.space.test.index.pk:info().disk.dump.count == 0 do fiber.sleep(0.001) end -stat = box.info.vinyl() +stat = box.stat.vinyl() stat.quota.used <= stat.quota.limit or {stat.quota.used, stat.quota.limit} _ = test_run:cmd('switch default') diff --git a/test/vinyl/tx_gap_lock.result b/test/vinyl/tx_gap_lock.result index a1275131..150826cb 100644 --- a/test/vinyl/tx_gap_lock.result +++ b/test/vinyl/tx_gap_lock.result @@ -681,7 +681,7 @@ s:drop() ---------------------------------------------------------------- -- Interval merging ---------------------------------------------------------------- -function gap_lock_count() return box.info.vinyl().tx.gap_locks end +function gap_lock_count() return box.stat.vinyl().tx.gap_locks end --- ... s = box.schema.space.create('test', {engine = 'vinyl'}) diff --git a/test/vinyl/tx_gap_lock.test.lua b/test/vinyl/tx_gap_lock.test.lua index d968349b..4d8d21d8 100644 --- a/test/vinyl/tx_gap_lock.test.lua +++ b/test/vinyl/tx_gap_lock.test.lua @@ -219,7 +219,7 @@ s:drop() ---------------------------------------------------------------- -- Interval merging ---------------------------------------------------------------- -function gap_lock_count() return box.info.vinyl().tx.gap_locks end +function gap_lock_count() return box.stat.vinyl().tx.gap_locks end s = box.schema.space.create('test', {engine = 'vinyl'}) _ = s:create_index('pk') diff --git a/test/vinyl/upgrade/fill.lua b/test/vinyl/upgrade/fill.lua index 37c0ab44..9010a489 100644 --- a/test/vinyl/upgrade/fill.lua +++ b/test/vinyl/upgrade/fill.lua @@ -17,7 +17,7 @@ dump_trigger:create_index('pk') function dump() pcall(dump_trigger.insert, dump_trigger, {1, string.rep('x', 1024 * 1024)}) - while box.info.vinyl().quota.used > 0 do + while box.stat.vinyl().quota.used > 0 do fiber.sleep(0.1) end end -- 2.11.0