1
0

pendingquerybuf.tcl 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. proc info_memory {r property} {
  2. if {[regexp "\r\n$property:(.*?)\r\n" [{*}$r info memory] _ value]} {
  3. set _ $value
  4. }
  5. }
  6. proc prepare_value {size} {
  7. set _v "c"
  8. for {set i 1} {$i < $size} {incr i} {
  9. append _v 0
  10. }
  11. return $_v
  12. }
  13. start_server {tags {"wait external:skip"}} {
  14. start_server {} {
  15. set slave [srv 0 client]
  16. set slave_host [srv 0 host]
  17. set slave_port [srv 0 port]
  18. set master [srv -1 client]
  19. set master_host [srv -1 host]
  20. set master_port [srv -1 port]
  21. test "pending querybuf: check size of pending_querybuf after set a big value" {
  22. $slave slaveof $master_host $master_port
  23. set _v [prepare_value [expr 32*1024*1024]]
  24. $master set key $_v
  25. wait_for_ofs_sync $master $slave
  26. wait_for_condition 50 100 {
  27. [info_memory $slave used_memory] <= [info_memory $master used_memory] + 10*1024*1024
  28. } else {
  29. fail "the used_memory of replica is much larger than master."
  30. }
  31. }
  32. }}