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
0e1be534
Commit
0e1be534
authored
Feb 13, 2013
by
antirez
Browse files
PSYNC: More robust handling of unexpected reply to PSYNC.
parent
7404b958
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/replication.c
View file @
0e1be534
...
...
@@ -956,6 +956,14 @@ int slaveTryPartialResynchronization(int fd) {
if
(
!
runid
||
!
offset
||
(
offset
-
runid
-
1
)
!=
REDIS_RUN_ID_SIZE
)
{
redisLog
(
REDIS_WARNING
,
"Master replied with wrong +FULLRESYNC syntax."
);
sdsfree
(
reply
);
/* This is an unexpected condition, actually the +FULLRESYNC
* reply means that the master supports PSYNC, but the reply
* format seems wrong. To stay safe we blank the master
* runid to make sure next PSYNCs will fail, and return
* NOT_SUPPORTED to the caller to use SYNC instead. */
memset
(
server
.
repl_master_runid
,
0
,
REDIS_RUN_ID_SIZE
+
1
);
return
PSYNC_NOT_SUPPORTED
;
}
else
{
memcpy
(
server
.
repl_master_runid
,
runid
,
offset
-
runid
-
1
);
server
.
repl_master_runid
[
REDIS_RUN_ID_SIZE
]
=
'\0'
;
...
...
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