replication-2.tcl 976 B

123456789101112131415161718192021222324252627
  1. start_server {tags {"repl"}} {
  2. start_server {} {
  3. test {First server should have role slave after SLAVEOF} {
  4. r -1 slaveof [srv 0 host] [srv 0 port]
  5. after 1000
  6. s -1 role
  7. } {slave}
  8. test {MASTER and SLAVE dataset should be identical after complex ops} {
  9. createComplexDataset r 10000
  10. after 500
  11. if {[r debug digest] ne [r -1 debug digest]} {
  12. set csv1 [csvdump r]
  13. set csv2 [csvdump {r -1}]
  14. set fd [open /tmp/repldump1.txt w]
  15. puts -nonewline $fd $csv1
  16. close $fd
  17. set fd [open /tmp/repldump2.txt w]
  18. puts -nonewline $fd $csv2
  19. close $fd
  20. puts "Master - Slave inconsistency"
  21. puts "Run diff -u against /tmp/repldump*.txt for more info"
  22. }
  23. assert_equal [r debug digest] [r -1 debug digest]
  24. }
  25. }
  26. }