replication-3.tcl 1.2 KB

12345678910111213141516171819202122232425262728293031
  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. if {$::accurate} {set numops 50000} else {set numops 5000}
  9. test {MASTER and SLAVE consistency with expire} {
  10. createComplexDataset r $numops useexpire
  11. after 4000 ;# Make sure everything expired before taking the digest
  12. r keys * ;# Force DEL syntesizing to slave
  13. after 1000 ;# Wait another second. Now everything should be fine.
  14. if {[r debug digest] ne [r -1 debug digest]} {
  15. set csv1 [csvdump r]
  16. set csv2 [csvdump {r -1}]
  17. set fd [open /tmp/repldump1.txt w]
  18. puts -nonewline $fd $csv1
  19. close $fd
  20. set fd [open /tmp/repldump2.txt w]
  21. puts -nonewline $fd $csv2
  22. close $fd
  23. puts "Master - Slave inconsistency"
  24. puts "Run diff -u against /tmp/repldump*.txt for more info"
  25. }
  26. assert_equal [r debug digest] [r -1 debug digest]
  27. }
  28. }
  29. }