mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
30 lines
1.1 KiB
Tcl
30 lines
1.1 KiB
Tcl
start_server {tags {"repl"}} {
|
|
start_server {} {
|
|
test {First server should have role slave after SLAVEOF} {
|
|
r -1 slaveof [srv 0 host] [srv 0 port]
|
|
after 1000
|
|
s -1 role
|
|
} {slave}
|
|
|
|
test {MASTER and SLAVE consistency with expire} {
|
|
createComplexDataset r 50000 useexpire
|
|
after 4000 ;# Make sure everything expired before taking the digest
|
|
r keys * ;# Force DEL syntesizing to slave
|
|
after 1000 ;# Wait another second. Now everything should be fine.
|
|
if {[r debug digest] ne [r -1 debug digest]} {
|
|
set csv1 [csvdump r]
|
|
set csv2 [csvdump {r -1}]
|
|
set fd [open /tmp/repldump1.txt w]
|
|
puts -nonewline $fd $csv1
|
|
close $fd
|
|
set fd [open /tmp/repldump2.txt w]
|
|
puts -nonewline $fd $csv2
|
|
close $fd
|
|
puts "Master - Slave inconsistency"
|
|
puts "Run diff -u against /tmp/repldump*.txt for more info"
|
|
}
|
|
assert_equal [r debug digest] [r -1 debug digest]
|
|
}
|
|
}
|
|
}
|