Fix check aof
This commit is contained in:
parent
3586485355
commit
9a6721bd11
@ -107,7 +107,7 @@ tags {"aof external:skip"} {
|
||||
## Test that redis-check-aof indeed sees this AOF is not valid
|
||||
test "Short read: Utility should confirm the AOF is not valid" {
|
||||
catch {
|
||||
exec src/redis-check-aof $aof_manifest_file
|
||||
exec src/placeholderkv-check-aof $aof_manifest_file
|
||||
} result
|
||||
assert_match "*not valid*" $result
|
||||
}
|
||||
@ -119,13 +119,13 @@ tags {"aof external:skip"} {
|
||||
}
|
||||
|
||||
catch {
|
||||
exec src/redis-check-aof $aof_manifest_file
|
||||
exec src/placeholderkv-check-aof $aof_manifest_file
|
||||
} result
|
||||
assert_match "*ok_up_to_line=8*" $result
|
||||
}
|
||||
|
||||
test "Short read: Utility should be able to fix the AOF" {
|
||||
set result [exec src/redis-check-aof --fix $aof_manifest_file << "y\n"]
|
||||
set result [exec src/placeholderkv-check-aof --fix $aof_manifest_file << "y\n"]
|
||||
assert_match "*Successfully truncated AOF*" $result
|
||||
}
|
||||
|
||||
@ -397,7 +397,7 @@ tags {"aof external:skip"} {
|
||||
|
||||
test {Truncate AOF to specific timestamp} {
|
||||
# truncate to timestamp 1628217473
|
||||
exec src/redis-check-aof --truncate-to-timestamp 1628217473 $aof_manifest_file
|
||||
exec src/placeholderkv-check-aof --truncate-to-timestamp 1628217473 $aof_manifest_file
|
||||
start_server_aof [list dir $server_path] {
|
||||
set c [redis [srv host] [srv port] 0 $::tls]
|
||||
wait_done_loading $c
|
||||
@ -407,7 +407,7 @@ tags {"aof external:skip"} {
|
||||
}
|
||||
|
||||
# truncate to timestamp 1628217471
|
||||
exec src/redis-check-aof --truncate-to-timestamp 1628217471 $aof_manifest_file
|
||||
exec src/placeholderkv-check-aof --truncate-to-timestamp 1628217471 $aof_manifest_file
|
||||
start_server_aof [list dir $server_path] {
|
||||
set c [redis [srv host] [srv port] 0 $::tls]
|
||||
wait_done_loading $c
|
||||
@ -417,7 +417,7 @@ tags {"aof external:skip"} {
|
||||
}
|
||||
|
||||
# truncate to timestamp 1628217470
|
||||
exec src/redis-check-aof --truncate-to-timestamp 1628217470 $aof_manifest_file
|
||||
exec src/placeholderkv-check-aof --truncate-to-timestamp 1628217470 $aof_manifest_file
|
||||
start_server_aof [list dir $server_path] {
|
||||
set c [redis [srv host] [srv port] 0 $::tls]
|
||||
wait_done_loading $c
|
||||
@ -426,7 +426,7 @@ tags {"aof external:skip"} {
|
||||
}
|
||||
|
||||
# truncate to timestamp 1628217469
|
||||
catch {exec src/redis-check-aof --truncate-to-timestamp 1628217469 $aof_manifest_file} e
|
||||
catch {exec src/placeholderkv-check-aof --truncate-to-timestamp 1628217469 $aof_manifest_file} e
|
||||
assert_match {*aborting*} $e
|
||||
}
|
||||
|
||||
@ -476,7 +476,7 @@ tags {"aof external:skip"} {
|
||||
}
|
||||
|
||||
catch {
|
||||
exec src/redis-check-aof $aof_file
|
||||
exec src/placeholderkv-check-aof $aof_file
|
||||
} result
|
||||
assert_match "*Start checking Old-Style AOF*is valid*" $result
|
||||
}
|
||||
@ -488,14 +488,14 @@ tags {"aof external:skip"} {
|
||||
}
|
||||
|
||||
catch {
|
||||
exec src/redis-check-aof $aof_file
|
||||
exec src/placeholderkv-check-aof $aof_file
|
||||
} result
|
||||
assert_match "*Start checking Old-Style AOF*is valid*" $result
|
||||
}
|
||||
|
||||
test {Test redis-check-aof for old style rdb-preamble AOF} {
|
||||
catch {
|
||||
exec src/redis-check-aof tests/assets/rdb-preamble.aof
|
||||
exec src/placeholderkv-check-aof tests/assets/rdb-preamble.aof
|
||||
} result
|
||||
assert_match "*Start checking Old-Style AOF*RDB preamble is OK, proceeding with AOF tail*is valid*" $result
|
||||
}
|
||||
@ -517,7 +517,7 @@ tags {"aof external:skip"} {
|
||||
}
|
||||
|
||||
catch {
|
||||
exec src/redis-check-aof $aof_manifest_file
|
||||
exec src/placeholderkv-check-aof $aof_manifest_file
|
||||
} result
|
||||
assert_match "*Start checking Multi Part AOF*Start to check BASE AOF (RESP format)*BASE AOF*is valid*Start to check INCR files*INCR AOF*is valid*All AOF files and manifest are valid*" $result
|
||||
}
|
||||
@ -536,7 +536,7 @@ tags {"aof external:skip"} {
|
||||
}
|
||||
|
||||
catch {
|
||||
exec src/redis-check-aof $aof_manifest_file
|
||||
exec src/placeholderkv-check-aof $aof_manifest_file
|
||||
} result
|
||||
assert_match "*Start checking Multi Part AOF*Start to check BASE AOF (RDB format)*DB preamble is OK, proceeding with AOF tail*BASE AOF*is valid*Start to check INCR files*INCR AOF*is valid*All AOF files and manifest are valid*" $result
|
||||
}
|
||||
@ -549,7 +549,7 @@ tags {"aof external:skip"} {
|
||||
}
|
||||
|
||||
catch {
|
||||
exec src/redis-check-aof $aof_manifest_file
|
||||
exec src/placeholderkv-check-aof $aof_manifest_file
|
||||
} result
|
||||
assert_match "*Invalid AOF manifest file format*" $result
|
||||
}
|
||||
@ -572,12 +572,12 @@ tags {"aof external:skip"} {
|
||||
}
|
||||
|
||||
catch {
|
||||
exec src/redis-check-aof $aof_manifest_file
|
||||
exec src/placeholderkv-check-aof $aof_manifest_file
|
||||
} result
|
||||
assert_match "*not valid*" $result
|
||||
|
||||
catch {
|
||||
exec src/redis-check-aof --fix $aof_manifest_file
|
||||
exec src/placeholderkv-check-aof --fix $aof_manifest_file
|
||||
} result
|
||||
assert_match "*Failed to truncate AOF*because it is not the last file*" $result
|
||||
}
|
||||
@ -605,7 +605,7 @@ tags {"aof external:skip"} {
|
||||
}
|
||||
|
||||
catch {
|
||||
exec src/redis-check-aof --truncate-to-timestamp 1628217473 $aof_manifest_file
|
||||
exec src/placeholderkv-check-aof --truncate-to-timestamp 1628217473 $aof_manifest_file
|
||||
} result
|
||||
assert_match "*Failed to truncate AOF*to timestamp*because it is not the last file*" $result
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ srcdir = os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + "/../src")
|
||||
if __name__ == '__main__':
|
||||
opts = {
|
||||
'description': 'Transform the output from `redis-cli --json` using COMMAND and COMMAND DOCS to a single commands.json format.',
|
||||
'epilog': f'Usage example: {argv[0]} --cli src/redis-cli --port 6379 > commands.json'
|
||||
'epilog': f'Usage example: {argv[0]} --cli src/placeholderkv-cli --port 6379 > commands.json'
|
||||
}
|
||||
parser = argparse.ArgumentParser(**opts)
|
||||
parser.add_argument('--host', type=str, default='localhost')
|
||||
|
Loading…
x
Reference in New Issue
Block a user