summaryrefslogtreecommitdiff
path: root/tests/integration/psync2-pingoff.tcl
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2020-05-27 12:47:34 +0200
committerantirez <antirez@gmail.com>2020-05-27 12:47:34 +0200
commit32d0df0c1fb5fdd39defc6d85887cca73d062f47 (patch)
treebdd61f8995821f93b2995bbe08279061b91f3e7b /tests/integration/psync2-pingoff.tcl
parent22472fe5a1e59e4c3f589a9ea38d17a2e1f04a96 (diff)
downloadredis-32d0df0c1fb5fdd39defc6d85887cca73d062f47.tar.gz
Remove the PSYNC2 meaningful offset test.
Diffstat (limited to 'tests/integration/psync2-pingoff.tcl')
-rw-r--r--tests/integration/psync2-pingoff.tcl112
1 files changed, 0 insertions, 112 deletions
diff --git a/tests/integration/psync2-pingoff.tcl b/tests/integration/psync2-pingoff.tcl
deleted file mode 100644
index 2c2303141..000000000
--- a/tests/integration/psync2-pingoff.tcl
+++ /dev/null
@@ -1,112 +0,0 @@
-# Test the meaningful offset implementation to make sure masters
-# are able to PSYNC with replicas even if the replication stream
-# has pending PINGs at the end.
-
-start_server {tags {"psync2"}} {
-start_server {} {
- # Config
- set debug_msg 0 ; # Enable additional debug messages
-
- for {set j 0} {$j < 2} {incr j} {
- set R($j) [srv [expr 0-$j] client]
- set R_host($j) [srv [expr 0-$j] host]
- set R_port($j) [srv [expr 0-$j] port]
- $R($j) CONFIG SET repl-ping-replica-period 1
- if {$debug_msg} {puts "Log file: [srv [expr 0-$j] stdout]"}
- }
-
- # Setup replication
- test "PSYNC2 meaningful offset: setup" {
- $R(1) replicaof $R_host(0) $R_port(0)
- $R(0) set foo bar
- wait_for_condition 50 1000 {
- [status $R(1) master_link_status] == "up" &&
- [$R(0) dbsize] == 1 && [$R(1) dbsize] == 1
- } else {
- fail "Replicas not replicating from master"
- }
- }
-
- test "PSYNC2 meaningful offset: write and wait replication" {
- $R(0) INCR counter
- $R(0) INCR counter
- $R(0) INCR counter
- wait_for_condition 50 1000 {
- [$R(0) GET counter] eq [$R(1) GET counter]
- } else {
- fail "Master and replica don't agree about counter"
- }
- }
-
- # In this test we'll make sure the replica will get stuck, but with
- # an active connection: this way the master will continue to send PINGs
- # every second (we modified the PING period earlier)
- test "PSYNC2 meaningful offset: pause replica and promote it" {
- $R(1) MULTI
- $R(1) DEBUG SLEEP 5
- $R(1) SLAVEOF NO ONE
- $R(1) EXEC
- $R(1) ping ; # Wait for it to return back available
- }
-
- test "Make the old master a replica of the new one and check conditions" {
- set sync_partial [status $R(1) sync_partial_ok]
- assert {$sync_partial == 0}
- $R(0) REPLICAOF $R_host(1) $R_port(1)
- wait_for_condition 50 1000 {
- [status $R(1) sync_partial_ok] == 1
- } else {
- fail "The new master was not able to partial sync"
- }
- }
-}}
-
-
-start_server {tags {"psync2"}} {
-start_server {} {
-start_server {} {
-
- for {set j 0} {$j < 3} {incr j} {
- set R($j) [srv [expr 0-$j] client]
- set R_host($j) [srv [expr 0-$j] host]
- set R_port($j) [srv [expr 0-$j] port]
- $R($j) CONFIG SET repl-ping-replica-period 1
- }
-
- test "Chained replicas disconnect when replica re-connect with the same master" {
- # Add a second replica as a chained replica of the current replica
- $R(1) replicaof $R_host(0) $R_port(0)
- $R(2) replicaof $R_host(1) $R_port(1)
- wait_for_condition 50 1000 {
- [status $R(2) master_link_status] == "up"
- } else {
- fail "Chained replica not replicating from its master"
- }
-
- # Do a write on the master, and wait for 3 seconds for the master to
- # send some PINGs to its replica
- $R(0) INCR counter2
- after 2000
- set sync_partial_master [status $R(0) sync_partial_ok]
- set sync_partial_replica [status $R(1) sync_partial_ok]
- $R(0) CONFIG SET repl-ping-replica-period 100
-
- # Disconnect the master's direct replica
- $R(0) client kill type replica
- wait_for_condition 50 1000 {
- [status $R(1) master_link_status] == "up" &&
- [status $R(2) master_link_status] == "up" &&
- [status $R(0) sync_partial_ok] == $sync_partial_master + 1 &&
- [status $R(1) sync_partial_ok] == $sync_partial_replica + 1
- } else {
- fail "Disconnected replica failed to PSYNC with master"
- }
-
- # Verify that the replica and its replica's meaningful and real
- # offsets match with the master
- assert_equal [status $R(0) master_repl_offset] [status $R(1) master_repl_offset]
- assert_equal [status $R(0) master_repl_offset] [status $R(2) master_repl_offset]
- assert_equal [status $R(0) master_repl_meaningful_offset] [status $R(1) master_repl_meaningful_offset]
- assert_equal [status $R(0) master_repl_meaningful_offset] [status $R(2) master_repl_meaningful_offset]
- }
-}}}