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
3d2c82b4
Commit
3d2c82b4
authored
Sep 08, 2014
by
antirez
Browse files
Tests for aof-load-truncated = yes.
parent
ea6082f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/integration/aof.tcl
View file @
3d2c82b4
...
@@ -23,6 +23,32 @@ proc start_server_aof {overrides code} {
...
@@ -23,6 +23,32 @@ proc start_server_aof {overrides code} {
}
}
tags
{
"aof"
}
{
tags
{
"aof"
}
{
## Server can start when aof-load-truncated is set to yes and AOF
## is truncated, with an incomplete MULTI block.
create_aof
{
append_to_aof
[
formatCommand set foo hello
]
append_to_aof
[
formatCommand multi
]
append_to_aof
[
formatCommand set bar world
]
}
start_server_aof
[
list dir $server_path aof-load-truncated yes
]
{
test
"Unfinished MULTI: Server should start if load-truncated is yes"
{
assert_equal 1
[
is_alive $srv
]
}
}
## Should also start with truncated AOF without incomplete MULTI block.
create_aof
{
append_to_aof
[
formatCommand set foo hello
]
append_to_aof
[
string range
[
formatCommand set bar world
]
0 end-1
]
}
start_server_aof
[
list dir $server_path aof-load-truncated yes
]
{
test
"Short read: Server should start if load-truncated is yes"
{
assert_equal 1
[
is_alive $srv
]
}
}
## Test that the server exits when the AOF contains a format error
## Test that the server exits when the AOF contains a format error
create_aof
{
create_aof
{
append_to_aof
[
formatCommand set foo hello
]
append_to_aof
[
formatCommand set foo hello
]
...
@@ -30,7 +56,7 @@ tags {"aof"} {
...
@@ -30,7 +56,7 @@ tags {"aof"} {
append_to_aof
[
formatCommand set foo hello
]
append_to_aof
[
formatCommand set foo hello
]
}
}
start_server_aof
[
list dir $server_path aof-load-truncated
no
]
{
start_server_aof
[
list dir $server_path aof-load-truncated
yes
]
{
test
"Bad format: Server should have logged an error"
{
test
"Bad format: Server should have logged an error"
{
set pattern
"*Bad file format reading the append only file*"
set pattern
"*Bad file format reading the append only file*"
set retry 10
set retry 10
...
...
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