File: recover_missing_xlog.test.lua

package info (click to toggle)
tarantool 2.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 85,364 kB
  • sloc: ansic: 513,760; cpp: 69,489; sh: 25,650; python: 19,190; perl: 14,973; makefile: 4,173; yacc: 1,329; sql: 1,074; pascal: 620; ruby: 190; awk: 18; lisp: 7
file content (41 lines) | stat: -rw-r--r-- 1,421 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
env = require('test_run')
test_run = env.new()

SERVERS = { 'autobootstrap1', 'autobootstrap2', 'autobootstrap3' }
-- Start servers
test_run:create_cluster(SERVERS, "replication", {args="0.1"})
-- Wait for full mesh
test_run:wait_fullmesh(SERVERS)

test_run:cmd("switch autobootstrap1")
for i = 0, 9 do box.space.test:insert{i, 'test' .. i} end
box.space.test:count()

test_run:cmd('switch default')
vclock1 = test_run:get_vclock('autobootstrap1')
vclock2 = test_run:wait_cluster_vclock(SERVERS, vclock1)

test_run:cmd("switch autobootstrap2")
box.space.test:count()
box.error.injection.set("ERRINJ_RELAY_TIMEOUT", 0.01)
test_run:cmd("stop server autobootstrap1")
fio = require('fio')
-- This test checks ability to recover missing local data
-- from remote replica. See #3210.
-- Delete data on first master and test that after restart,
-- due to difference in vclock it will be able to recover
-- all missing data from replica.
-- Also check that there is no concurrency, i.e. master is
-- in 'read-only' mode unless it receives all data.
list = fio.glob(fio.pathjoin(fio.abspath("."), 'autobootstrap1/*.xlog'))
fio.unlink(list[#list])
test_run:cmd('start server autobootstrap1 with args="0.1"')

test_run:cmd("switch autobootstrap1")
for i = 10, 19 do box.space.test:insert{i, 'test' .. i} end
fiber = require('fiber')
box.space.test:select()

-- Cleanup.
test_run:cmd('switch default')
test_run:drop_cluster(SERVERS)