1 proc start_bg_complex_data
{host port db ops
} {
2 exec tclsh8.5 tests
/helpers
/bg_complex_data.tcl
$host $port $db $ops &
5 proc stop_bg_complex_data
{handle
} {
6 catch {exec /bin
/kill
-9 $handle}
9 start_server
{tags
{"repl"}} {
12 set master
[srv
0 client
]
13 set master_host
[srv
0 host
]
14 set master_port
[srv
0 port
]
15 set load_handle0
[start_bg_complex_data
$master_host $master_port 9 100000]
16 set load_handle1
[start_bg_complex_data
$master_host $master_port 11 100000]
17 set load_handle2
[start_bg_complex_data
$master_host $master_port 12 100000]
19 test
{First server should have role slave
after SLAVEOF
} {
20 r
-1 slaveof
[srv
0 host
] [srv
0 port
]
25 test
{Test replication with parallel clients writing in differnet DBs
} {
26 lappend slave
[srv
0 client
]
28 stop_bg_complex_data
$load_handle0
29 stop_bg_complex_data
$load_handle1
30 stop_bg_complex_data
$load_handle2
32 while {$retry && ([$master debug digest
] ne
[$slave debug digest
])}\
37 assert
{[$master dbsize
] > 0}
39 if {[r debug digest
] ne
[r
-1 debug digest
]} {
41 set csv2
[csvdump
{r
-1}]
42 set fd
[open /tmp
/repldump1.txt w
]
43 puts -nonewline $fd $csv1
45 set fd
[open /tmp
/repldump2.txt w
]
46 puts -nonewline $fd $csv2
48 puts "Master - Slave inconsistency"
49 puts "Run diff -u against /tmp/repldump*.txt for more info"
51 assert_equal
[r debug digest
] [r
-1 debug digest
]