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
aa6deff0
Unverified
Commit
aa6deff0
authored
Oct 18, 2021
by
DarrenJiang13
Committed by
GitHub
Oct 18, 2021
Browse files
add missed error counting (#9646)
* add: add missed error counting in sentinel.c and cluster.c
parent
81095b1b
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
aa6deff0
...
@@ -5755,10 +5755,9 @@ socket_err:
...
@@ -5755,10 +5755,9 @@ socket_err:
/* Cleanup we want to do if no retry is attempted. */
/* Cleanup we want to do if no retry is attempted. */
zfree
(
ov
);
zfree
(
kv
);
zfree
(
ov
);
zfree
(
kv
);
addReplySds
(
c
,
addReplyErrorSds
(
c
,
sdscatprintf
(
sdsempty
(),
sdscatprintf
(
sdsempty
(),
"-IOERR error or timeout %s to target instance"
,
"-IOERR error or timeout %s to target instance
\r\n
"
,
write_error
?
"writing"
:
"reading"
));
write_error
?
"writing"
:
"reading"
));
return
;
return
;
}
}
...
...
src/sentinel.c
View file @
aa6deff0
...
@@ -3885,11 +3885,11 @@ NULL
...
@@ -3885,11 +3885,11 @@ NULL
if
((
ri
=
sentinelGetMasterByNameOrReplyError
(
c
,
c
->
argv
[
2
]))
==
NULL
)
if
((
ri
=
sentinelGetMasterByNameOrReplyError
(
c
,
c
->
argv
[
2
]))
==
NULL
)
return
;
return
;
if
(
ri
->
flags
&
SRI_FAILOVER_IN_PROGRESS
)
{
if
(
ri
->
flags
&
SRI_FAILOVER_IN_PROGRESS
)
{
addReply
Sds
(
c
,
sdsnew
(
"-INPROG Failover already in progress
\r\n
"
)
);
addReply
Error
(
c
,
"-INPROG Failover already in progress
"
);
return
;
return
;
}
}
if
(
sentinelSelectSlave
(
ri
)
==
NULL
)
{
if
(
sentinelSelectSlave
(
ri
)
==
NULL
)
{
addReply
Sds
(
c
,
sdsnew
(
"-NOGOODSLAVE No suitable replica to promote
\r\n
"
)
);
addReply
Error
(
c
,
"-NOGOODSLAVE No suitable replica to promote
"
);
return
;
return
;
}
}
serverLog
(
LL_WARNING
,
"Executing user requested FAILOVER of '%s'"
,
serverLog
(
LL_WARNING
,
"Executing user requested FAILOVER of '%s'"
,
...
@@ -3978,8 +3978,7 @@ NULL
...
@@ -3978,8 +3978,7 @@ NULL
e
=
sdscat
(
e
,
"Not enough available Sentinels to reach the"
e
=
sdscat
(
e
,
"Not enough available Sentinels to reach the"
" majority and authorize a failover"
);
" majority and authorize a failover"
);
}
}
e
=
sdscat
(
e
,
"
\r\n
"
);
addReplyErrorSds
(
c
,
e
);
addReplySds
(
c
,
e
);
}
}
}
else
if
(
!
strcasecmp
(
c
->
argv
[
1
]
->
ptr
,
"set"
))
{
}
else
if
(
!
strcasecmp
(
c
->
argv
[
1
]
->
ptr
,
"set"
))
{
if
(
c
->
argc
<=
3
)
goto
numargserr
;
if
(
c
->
argc
<=
3
)
goto
numargserr
;
...
...
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