Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
6dc3f09c
Unverified
Commit
6dc3f09c
authored
Jan 24, 2022
by
chenyang8094
Committed by
GitHub
Jan 24, 2022
Browse files
Fix AOFRW limit test occasional failures on slower machines (#10164)
parent
b40a9ba5
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/integration/aof-multi-part.tcl
View file @
6dc3f09c
...
@@ -1090,10 +1090,19 @@ tags {"external:skip"} {
...
@@ -1090,10 +1090,19 @@ tags {"external:skip"} {
}
}
test
"AOF will trigger limit when AOFRW fails many times"
{
test
"AOF will trigger limit when AOFRW fails many times"
{
# Clear all data and trigger a successful AOFRW, so we can let
# server.aof_current_size equal to 0
r flushall
r bgrewriteaof
waitForBgrewriteaof r
r config set rdb-key-save-delay 10000000
r config set rdb-key-save-delay 10000000
# Let us trigger AOFRW easily
# Let us trigger AOFRW easily
r config set auto-aof-rewrite-percentage 1
r config set auto-aof-rewrite-percentage 1
r config set auto-aof-rewrite-min-size 1mb
r config set auto-aof-rewrite-min-size 1kb
# Set a key so that AOFRW can be delayed
r set k v
# Let AOFRW fail two times, this will trigger AOFRW limit
# Let AOFRW fail two times, this will trigger AOFRW limit
r bgrewriteaof
r bgrewriteaof
...
@@ -1105,35 +1114,29 @@ tags {"external:skip"} {
...
@@ -1105,35 +1114,29 @@ tags {"external:skip"} {
waitForBgrewriteaof r
waitForBgrewriteaof r
assert_aof_manifest_content $aof_manifest_file
{
assert_aof_manifest_content $aof_manifest_file
{
{
file appendonly.aof.9.base.rdb seq 9 type b
}
{
file appendonly.aof.10.base.rdb seq 10 type b
}
{
file appendonly.aof.5.incr.aof seq 5 type i
}
{
file appendonly.aof.6.incr.aof seq 6 type i
}
{
file appendonly.aof.6.incr.aof seq 6 type i
}
{
file appendonly.aof.7.incr.aof seq 7 type i
}
{
file appendonly.aof.7.incr.aof seq 7 type i
}
{
file appendonly.aof.8.incr.aof seq 8 type i
}
}
}
set orig_size
[
r dbsize
]
# Write 1KB data to trigger AOFRW
set load_handle0
[
start_write_load $master_host $master_port 10
]
r set x
[
string repeat x 1024
]
wait_for_condition 50 100
{
[
r dbsize
]
> $orig_size
}
else
{
fail
"No write load detected."
}
# Make sure we have limit log
# Make sure we have limit log
wait_for_condition 1000
1
0
{
wait_for_condition 1000
5
0
{
[
count_log_message 0
"triggered the limit"
]
== 1
[
count_log_message 0
"triggered the limit"
]
== 1
}
else
{
}
else
{
fail
"aof rewrite did trigger limit"
fail
"aof rewrite did
not
trigger limit"
}
}
assert_equal
[
status r aof_rewrite_in_progress
]
0
assert_equal
[
status r aof_rewrite_in_progress
]
0
# No new INCR AOF be created
# No new INCR AOF be created
assert_aof_manifest_content $aof_manifest_file
{
assert_aof_manifest_content $aof_manifest_file
{
{
file appendonly.aof.9.base.rdb seq 9 type b
}
{
file appendonly.aof.10.base.rdb seq 10 type b
}
{
file appendonly.aof.5.incr.aof seq 5 type i
}
{
file appendonly.aof.6.incr.aof seq 6 type i
}
{
file appendonly.aof.6.incr.aof seq 6 type i
}
{
file appendonly.aof.7.incr.aof seq 7 type i
}
{
file appendonly.aof.7.incr.aof seq 7 type i
}
{
file appendonly.aof.8.incr.aof seq 8 type i
}
}
}
# Turn off auto rewrite
# Turn off auto rewrite
...
@@ -1151,16 +1154,13 @@ tags {"external:skip"} {
...
@@ -1151,16 +1154,13 @@ tags {"external:skip"} {
waitForBgrewriteaof r
waitForBgrewriteaof r
# Can create New INCR AOF
# Can create New INCR AOF
assert_equal 1
[
check_file_exist $aof_dirpath
"
${aof_basename}
.
8
${::incr_aof_sufix}${::aof_format_suffix}
"
]
assert_equal 1
[
check_file_exist $aof_dirpath
"
${aof_basename}
.
9
${::incr_aof_sufix}${::aof_format_suffix}
"
]
assert_aof_manifest_content $aof_manifest_file
{
assert_aof_manifest_content $aof_manifest_file
{
{
file appendonly.aof.1
0
.base.rdb seq 1
0
type b
}
{
file appendonly.aof.1
1
.base.rdb seq 1
1
type b
}
{
file appendonly.aof.
8
.incr.aof seq
8
type i
}
{
file appendonly.aof.
9
.incr.aof seq
9
type i
}
}
}
stop_write_load $load_handle0
wait_load_handlers_disconnected
set d1
[
r debug digest
]
set d1
[
r debug digest
]
r debug loadaof
r debug loadaof
set d2
[
r debug digest
]
set d2
[
r debug digest
]
...
...
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