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
71fbe6e8
Unverified
Commit
71fbe6e8
authored
Jan 02, 2021
by
Oran Agra
Committed by
GitHub
Jan 02, 2021
Browse files
Fix leak in new errorstats commit, and a flaky test (#8278)
parent
152b5d46
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/server.c
View file @
71fbe6e8
...
...
@@ -3301,7 +3301,7 @@ void resetCommandTableStats(void) {
}
void resetErrorTableStats(void) {
raxFree(server.errors);
raxFree
WithCallback
(server.errors
, zfree
);
server.errors = raxNew();
}
...
...
tests/cluster/tests/18-info.tcl
View file @
71fbe6e8
...
...
@@ -26,11 +26,20 @@ test "errorstats: rejected call due to MOVED Redirection" {
$primary2 config resetstat
assert_match
{}
[
errorstat $primary1 MOVED
]
assert_match
{}
[
errorstat $primary2 MOVED
]
# we know that the primary 2 will have a MOVED reply
catch
{
$primary1
set key
{
0x0000
}
b
}
replyP1
catch
{
$primary2
set key
{
0x0000
}
b
}
replyP2
assert_match
{
OK
}
$replyP1
assert_match
{}
[
errorstat $primary1 MOVED
]
assert_match
{
*count=1*
}
[
errorstat $primary2 MOVED
]
assert_match
{
*calls=0,*,rejected_calls=1,failed_calls=0
}
[
cmdstat $primary2 set
]
# we know that one will have a MOVED reply and one will succeed
catch
{
$primary1
set key b
}
replyP1
catch
{
$primary2
set key b
}
replyP2
# sort servers so we know which one failed
if
{
$reply
P1 eq
{
OK
}}
{
assert_match
{
MOVED*
}
$replyP2
set pok $primary1
set perr $primary2
}
else
{
assert_match
{
MOVED*
}
$replyP1
set pok $primary2
set perr $primary1
}
assert_match
{}
[
errorstat $pok MOVED
]
assert_match
{
*count=1*
}
[
errorstat $perr MOVED
]
assert_match
{
*calls=0,*,rejected_calls=1,failed_calls=0
}
[
cmdstat $perr set
]
}
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