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
51ab31db
Commit
51ab31db
authored
May 05, 2020
by
antirez
Browse files
Dump recent backlog on master query generating errors.
parent
415c4f61
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/networking.c
View file @
51ab31db
...
@@ -393,6 +393,35 @@ void addReplyErrorLength(client *c, const char *s, size_t len) {
...
@@ -393,6 +393,35 @@ void addReplyErrorLength(client *c, const char *s, size_t len) {
serverLog
(
LL_WARNING
,
"== CRITICAL == This %s is sending an error "
serverLog
(
LL_WARNING
,
"== CRITICAL == This %s is sending an error "
"to its %s: '%s' after processing the command "
"to its %s: '%s' after processing the command "
"'%s'"
,
from
,
to
,
s
,
cmdname
);
"'%s'"
,
from
,
to
,
s
,
cmdname
);
if
(
ctype
==
CLIENT_TYPE_MASTER
&&
server
.
repl_backlog
&&
server
.
repl_backlog_histlen
>
0
)
{
long
long
dumplen
=
256
;
if
(
server
.
repl_backlog_histlen
<
dumplen
)
dumplen
=
server
.
repl_backlog_histlen
;
/* Identify the first byte to dump. */
long
long
idx
=
(
server
.
repl_backlog_idx
+
(
server
.
repl_backlog_size
-
dumplen
))
%
server
.
repl_backlog_size
;
/* Scan the circular buffer to collect 'dumplen' bytes. */
sds
dump
=
sdsempty
();
while
(
dumplen
)
{
long
long
thislen
=
((
server
.
repl_backlog_size
-
idx
)
<
dumplen
)
?
(
server
.
repl_backlog_size
-
idx
)
:
dumplen
;
dump
=
sdscatrepr
(
dump
,
server
.
repl_backlog
+
idx
,
thislen
);
dumplen
-=
thislen
;
idx
=
0
;
}
/* Finally log such bytes: this is vital debugging info to
* understand what happened. */
serverLog
(
LL_WARNING
,
"Latest backlog is: '%s'"
,
dump
);
sdsfree
(
dump
);
}
server
.
stat_unexpected_error_replies
++
;
server
.
stat_unexpected_error_replies
++
;
}
}
}
}
...
...
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