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
132be8ae
Commit
132be8ae
authored
Aug 26, 2018
by
Chris Lamb
Browse files
Correct "did not received" -> "did not receive" typos/grammar.
parent
46d89a9a
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/scripting.c
View file @
132be8ae
...
@@ -1725,7 +1725,7 @@ int ldbRemoveChild(pid_t pid) {
...
@@ -1725,7 +1725,7 @@ int ldbRemoveChild(pid_t pid) {
return
0
;
return
0
;
}
}
/* Return the number of children we still did not receive
d
termination
/* Return the number of children we still did not receive termination
* acknowledge via wait() in the parent process. */
* acknowledge via wait() in the parent process. */
int
ldbPendingChildren
(
void
)
{
int
ldbPendingChildren
(
void
)
{
return
listLength
(
ldb
.
children
);
return
listLength
(
ldb
.
children
);
...
...
src/sentinel.c
View file @
132be8ae
...
@@ -2628,7 +2628,7 @@ int sentinelSendPing(sentinelRedisInstance *ri) {
...
@@ -2628,7 +2628,7 @@ int sentinelSendPing(sentinelRedisInstance *ri) {
ri
->
link
->
last_ping_time
=
mstime
();
ri
->
link
->
last_ping_time
=
mstime
();
/* We update the active ping time only if we received the pong for
/* We update the active ping time only if we received the pong for
* the previous ping, otherwise we are technically waiting since the
* the previous ping, otherwise we are technically waiting since the
* first ping that did not receive
d
a reply. */
* first ping that did not receive a reply. */
if
(
ri
->
link
->
act_ping_time
==
0
)
if
(
ri
->
link
->
act_ping_time
==
0
)
ri
->
link
->
act_ping_time
=
ri
->
link
->
last_ping_time
;
ri
->
link
->
act_ping_time
=
ri
->
link
->
last_ping_time
;
return
1
;
return
1
;
...
@@ -3569,7 +3569,7 @@ void sentinelCheckSubjectivelyDown(sentinelRedisInstance *ri) {
...
@@ -3569,7 +3569,7 @@ void sentinelCheckSubjectivelyDown(sentinelRedisInstance *ri) {
(
mstime
()
-
ri
->
link
->
cc_conn_time
)
>
(
mstime
()
-
ri
->
link
->
cc_conn_time
)
>
SENTINEL_MIN_LINK_RECONNECT_PERIOD
&&
SENTINEL_MIN_LINK_RECONNECT_PERIOD
&&
ri
->
link
->
act_ping_time
!=
0
&&
/* There is a pending ping... */
ri
->
link
->
act_ping_time
!=
0
&&
/* There is a pending ping... */
/* The pending ping is delayed, and we did not receive
d
/* The pending ping is delayed, and we did not receive
* error replies as well. */
* error replies as well. */
(
mstime
()
-
ri
->
link
->
act_ping_time
)
>
(
ri
->
down_after_period
/
2
)
&&
(
mstime
()
-
ri
->
link
->
act_ping_time
)
>
(
ri
->
down_after_period
/
2
)
&&
(
mstime
()
-
ri
->
link
->
last_pong_time
)
>
(
ri
->
down_after_period
/
2
))
(
mstime
()
-
ri
->
link
->
last_pong_time
)
>
(
ri
->
down_after_period
/
2
))
...
@@ -3725,7 +3725,7 @@ void sentinelAskMasterStateToOtherSentinels(sentinelRedisInstance *master, int f
...
@@ -3725,7 +3725,7 @@ void sentinelAskMasterStateToOtherSentinels(sentinelRedisInstance *master, int f
*
*
* 1) We believe it is down, or there is a failover in progress.
* 1) We believe it is down, or there is a failover in progress.
* 2) Sentinel is connected.
* 2) Sentinel is connected.
* 3) We did not receive
d
the info within SENTINEL_ASK_PERIOD ms. */
* 3) We did not receive the info within SENTINEL_ASK_PERIOD ms. */
if
((
master
->
flags
&
SRI_S_DOWN
)
==
0
)
continue
;
if
((
master
->
flags
&
SRI_S_DOWN
)
==
0
)
continue
;
if
(
ri
->
link
->
disconnected
)
continue
;
if
(
ri
->
link
->
disconnected
)
continue
;
if
(
!
(
flags
&
SENTINEL_ASK_FORCED
)
&&
if
(
!
(
flags
&
SENTINEL_ASK_FORCED
)
&&
...
...
tests/sentinel/tests/00-base.tcl
View file @
132be8ae
...
@@ -17,7 +17,7 @@ test "Basic failover works if the master is down" {
...
@@ -17,7 +17,7 @@ test "Basic failover works if the master is down" {
wait_for_condition 1000 50
{
wait_for_condition 1000 50
{
[
lindex
[
S $id SENTINEL GET-MASTER-ADDR-BY-NAME mymaster
]
1
]
!= $old_port
[
lindex
[
S $id SENTINEL GET-MASTER-ADDR-BY-NAME mymaster
]
1
]
!= $old_port
}
else
{
}
else
{
fail
"At least one Sentinel did not receive
d
failover info"
fail
"At least one Sentinel did not receive failover info"
}
}
}
}
restart_instance redis $master_id
restart_instance redis $master_id
...
@@ -108,7 +108,7 @@ test "Failover works if we configure for absolute agreement" {
...
@@ -108,7 +108,7 @@ test "Failover works if we configure for absolute agreement" {
wait_for_condition 1000 50
{
wait_for_condition 1000 50
{
[
lindex
[
S $id SENTINEL GET-MASTER-ADDR-BY-NAME mymaster
]
1
]
!= $old_port
[
lindex
[
S $id SENTINEL GET-MASTER-ADDR-BY-NAME mymaster
]
1
]
!= $old_port
}
else
{
}
else
{
fail
"At least one Sentinel did not receive
d
failover info"
fail
"At least one Sentinel did not receive failover info"
}
}
}
}
restart_instance redis $master_id
restart_instance redis $master_id
...
...
tests/sentinel/tests/01-conf-update.tcl
View file @
132be8ae
...
@@ -16,7 +16,7 @@ test "We can failover with Sentinel 1 crashed" {
...
@@ -16,7 +16,7 @@ test "We can failover with Sentinel 1 crashed" {
wait_for_condition 1000 50
{
wait_for_condition 1000 50
{
[
lindex
[
S $id SENTINEL GET-MASTER-ADDR-BY-NAME mymaster
]
1
]
!= $old_port
[
lindex
[
S $id SENTINEL GET-MASTER-ADDR-BY-NAME mymaster
]
1
]
!= $old_port
}
else
{
}
else
{
fail
"Sentinel
$id
did not receive
d
failover info"
fail
"Sentinel
$id
did not receive failover info"
}
}
}
}
}
}
...
@@ -30,7 +30,7 @@ test "After Sentinel 1 is restarted, its config gets updated" {
...
@@ -30,7 +30,7 @@ test "After Sentinel 1 is restarted, its config gets updated" {
wait_for_condition 1000 50
{
wait_for_condition 1000 50
{
[
lindex
[
S 1 SENTINEL GET-MASTER-ADDR-BY-NAME mymaster
]
1
]
!= $old_port
[
lindex
[
S 1 SENTINEL GET-MASTER-ADDR-BY-NAME mymaster
]
1
]
!= $old_port
}
else
{
}
else
{
fail
"Restarted Sentinel did not receive
d
failover info"
fail
"Restarted Sentinel did not receive failover info"
}
}
}
}
...
...
tests/sentinel/tests/02-slaves-reconf.tcl
View file @
132be8ae
...
@@ -36,7 +36,7 @@ proc 02_crash_and_failover {} {
...
@@ -36,7 +36,7 @@ proc 02_crash_and_failover {} {
wait_for_condition 1000 50
{
wait_for_condition 1000 50
{
[
lindex
[
S $id SENTINEL GET-MASTER-ADDR-BY-NAME mymaster
]
1
]
!= $old_port
[
lindex
[
S $id SENTINEL GET-MASTER-ADDR-BY-NAME mymaster
]
1
]
!= $old_port
}
else
{
}
else
{
fail
"At least one Sentinel did not receive
d
failover info"
fail
"At least one Sentinel did not receive failover info"
}
}
}
}
restart_instance redis $master_id
restart_instance redis $master_id
...
...
tests/sentinel/tests/05-manual.tcl
View file @
132be8ae
...
@@ -12,7 +12,7 @@ test "Manual failover works" {
...
@@ -12,7 +12,7 @@ test "Manual failover works" {
wait_for_condition 1000 50
{
wait_for_condition 1000 50
{
[
lindex
[
S $id SENTINEL GET-MASTER-ADDR-BY-NAME mymaster
]
1
]
!= $old_port
[
lindex
[
S $id SENTINEL GET-MASTER-ADDR-BY-NAME mymaster
]
1
]
!= $old_port
}
else
{
}
else
{
fail
"At least one Sentinel did not receive
d
failover info"
fail
"At least one Sentinel did not receive failover info"
}
}
}
}
set addr
[
S 0 SENTINEL GET-MASTER-ADDR-BY-NAME mymaster
]
set addr
[
S 0 SENTINEL GET-MASTER-ADDR-BY-NAME mymaster
]
...
...
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