diff --git a/src/box/box.cc b/src/box/box.cc index 0e076f027efe62c7d0f3b1a0375fcb8bc3639aa3..d71afa114693bee252ba855a52d03f95be11a53f 100644 --- a/src/box/box.cc +++ b/src/box/box.cc @@ -1955,6 +1955,7 @@ local_recovery(const struct tt_uuid *instance_uuid, engine_begin_final_recovery_xc(); recover_remaining_wals(recovery, &wal_stream.base, NULL, false); + engine_end_recovery_xc(); /* * Leave hot standby mode, if any, only after * acquiring the lock. @@ -1992,8 +1993,6 @@ local_recovery(const struct tt_uuid *instance_uuid, if (wal_enable() != 0) diag_raise(); - engine_end_recovery_xc(); - /* Check replica set UUID. */ if (!tt_uuid_is_nil(replicaset_uuid) && !tt_uuid_is_equal(replicaset_uuid, &REPLICASET_UUID)) { diff --git a/src/box/gc.c b/src/box/gc.c index e0df92473010201690387b28886d5c39027f2eb8..f5c387f9d78ca633b1819bcb257388e5459569ce 100644 --- a/src/box/gc.c +++ b/src/box/gc.c @@ -113,6 +113,7 @@ gc_init(void) gc_tree_new(&gc.consumers); fiber_cond_create(&gc.cleanup_cond); checkpoint_schedule_cfg(&gc.checkpoint_schedule, 0, 0); + engine_collect_garbage(&gc.vclock); gc.cleanup_fiber = fiber_new("gc", gc_cleanup_fiber_f); if (gc.cleanup_fiber == NULL) diff --git a/src/box/memtx_engine.c b/src/box/memtx_engine.c index eb11346c1e80c6b4d1cd5070e96bc45af1ad50ea..ecce3b1b63e5dc35615f3f34cd0184cbf7db234c 100644 --- a/src/box/memtx_engine.c +++ b/src/box/memtx_engine.c @@ -315,7 +315,6 @@ memtx_engine_end_recovery(struct engine *engine) if (space_foreach(memtx_build_secondary_keys, memtx) != 0) return -1; } - xdir_collect_inprogress(&memtx->snap_dir); return 0; } @@ -722,6 +721,7 @@ memtx_engine_collect_garbage(struct engine *engine, const struct vclock *vclock) struct memtx_engine *memtx = (struct memtx_engine *)engine; xdir_collect_garbage(&memtx->snap_dir, vclock_sum(vclock), XDIR_GC_ASYNC); + xdir_collect_inprogress(&memtx->snap_dir); } static int diff --git a/test/box/errinj.result b/test/box/errinj.result index 5a04e1fb2b2ff98c393e16e96f65ef12e49d908c..a148346e8204eb5ab0d0a0961b20417594488aba 100644 --- a/test/box/errinj.result +++ b/test/box/errinj.result @@ -1668,18 +1668,6 @@ errinj.set('ERRINJ_VY_GC', false) --- - ok ... -#fio.glob(fio.pathjoin(box.cfg.vinyl_dir, '*.vylog.inprogress')) > 0 ---- -- true -... -#fio.glob(fio.pathjoin(box.cfg.vinyl_dir, box.space.test.id, 0, '*.run.inprogress')) > 0 ---- -- true -... -#fio.glob(fio.pathjoin(box.cfg.vinyl_dir, box.space.test.id, 0, '*.index.inprogress')) > 0 ---- -- true -... test_run:cmd('restart server default') fio = require('fio') --- diff --git a/test/box/errinj.test.lua b/test/box/errinj.test.lua index db26d2e10f28bbf4eaabbcc6087311c5cf284df1..31dd9665bd5c08da2db4f4aa5770822cb1fa7926 100644 --- a/test/box/errinj.test.lua +++ b/test/box/errinj.test.lua @@ -580,10 +580,6 @@ errinj.set('ERRINJ_VY_INDEX_FILE_RENAME', false) errinj.set('ERRINJ_VY_SCHED_TIMEOUT', 0) errinj.set('ERRINJ_VY_GC', false) -#fio.glob(fio.pathjoin(box.cfg.vinyl_dir, '*.vylog.inprogress')) > 0 -#fio.glob(fio.pathjoin(box.cfg.vinyl_dir, box.space.test.id, 0, '*.run.inprogress')) > 0 -#fio.glob(fio.pathjoin(box.cfg.vinyl_dir, box.space.test.id, 0, '*.index.inprogress')) > 0 - test_run:cmd('restart server default') fio = require('fio') diff --git a/test/replication/hot_standby.result b/test/replication/hot_standby.result index b140887dff3f2209f45fba60ed5b481097668146..5dc12a46224e7fc1bec6fee5d4a350d262002e90 100644 --- a/test/replication/hot_standby.result +++ b/test/replication/hot_standby.result @@ -130,6 +130,9 @@ space = box.schema.space.create('tweedledum', {engine = engine}) index = space:create_index('primary', {type = 'tree'}) --- ... +index = space:create_index('secondary', {type = 'tree'}) +--- +... -- set begin lsn on master, replica and hot_standby. test_run:cmd("set variable replica_port to 'replica.listen'") --- @@ -203,6 +206,19 @@ test_run:cmd("switch hot_standby") _wait_lsn(10) --- ... +box.space.tweedledum.index[1]:select() +--- +- - [1, 'the tuple 1'] + - [2, 'the tuple 2'] + - [3, 'the tuple 3'] + - [4, 'the tuple 4'] + - [5, 'the tuple 5'] + - [6, 'the tuple 6'] + - [7, 'the tuple 7'] + - [8, 'the tuple 8'] + - [9, 'the tuple 9'] + - [10, 'the tuple 10'] +... test_run:cmd("switch replica") --- - true diff --git a/test/replication/hot_standby.test.lua b/test/replication/hot_standby.test.lua index f43982f1594c4a8e50e9eec266dfb7a1ac5f89f8..73a5329a7fd554d6ed2702f04032690000ac8ff1 100644 --- a/test/replication/hot_standby.test.lua +++ b/test/replication/hot_standby.test.lua @@ -71,6 +71,7 @@ box.info.status space = box.schema.space.create('tweedledum', {engine = engine}) index = space:create_index('primary', {type = 'tree'}) +index = space:create_index('secondary', {type = 'tree'}) -- set begin lsn on master, replica and hot_standby. test_run:cmd("set variable replica_port to 'replica.listen'") @@ -92,6 +93,7 @@ _select(1, 10) -- Check box.info.vclock is updated during hot standby. test_run:cmd("switch hot_standby") _wait_lsn(10) +box.space.tweedledum.index[1]:select() test_run:cmd("switch replica") _wait_lsn(10)