Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
352408a8
Commit
352408a8
authored
May 27, 2020
by
antirez
Browse files
Remove the PSYNC2 meaningful offset test.
parent
5418c813
Changes
2
Show whitespace changes
Inline
Side-by-side
tests/integration/psync2-pingoff.tcl
deleted
100644 → 0
View file @
5418c813
# 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"
}
}
}}
tests/test_helper.tcl
View file @
352408a8
...
@@ -47,7 +47,6 @@ set ::all_tests {
...
@@ -47,7 +47,6 @@ set ::all_tests {
integration/logging
integration/logging
integration/psync2
integration/psync2
integration/psync2-reg
integration/psync2-reg
integration/psync2-pingoff
unit/pubsub
unit/pubsub
unit/slowlog
unit/slowlog
unit/scripting
unit/scripting
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment