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
b1337b15
Commit
b1337b15
authored
Oct 17, 2014
by
antirez
Browse files
Diskless replication: Various fixes to backgroundSaveDoneHandlerSocket()
parent
4b16263b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/rdb.c
View file @
b1337b15
...
@@ -1299,11 +1299,11 @@ void backgroundSaveDoneHandlerSocket(int exitcode, int bysignal) {
...
@@ -1299,11 +1299,11 @@ void backgroundSaveDoneHandlerSocket(int exitcode, int bysignal) {
* can continue to be emtpy, so that it's just a speical case of the
* can continue to be emtpy, so that it's just a speical case of the
* normal code path. */
* normal code path. */
ok_slaves
=
zmalloc
(
sizeof
(
uint64_t
));
/* Make space for the count. */
ok_slaves
=
zmalloc
(
sizeof
(
uint64_t
));
/* Make space for the count. */
ok_slaves
=
0
;
ok_slaves
[
0
]
=
0
;
if
(
!
bysignal
&&
exitcode
==
0
)
{
if
(
!
bysignal
&&
exitcode
==
0
)
{
int
readlen
=
sizeof
(
uint64_t
);
int
readlen
=
sizeof
(
uint64_t
);
if
(
read
(
server
.
rdb_pipe_read_result_from_child
,
ok_slaves
,
readlen
)
!
=
if
(
read
(
server
.
rdb_pipe_read_result_from_child
,
ok_slaves
,
readlen
)
=
=
readlen
)
readlen
)
{
{
readlen
=
ok_slaves
[
0
]
*
sizeof
(
uint64_t
);
readlen
=
ok_slaves
[
0
]
*
sizeof
(
uint64_t
);
...
@@ -1335,14 +1335,18 @@ void backgroundSaveDoneHandlerSocket(int exitcode, int bysignal) {
...
@@ -1335,14 +1335,18 @@ void backgroundSaveDoneHandlerSocket(int exitcode, int bysignal) {
if
(
slave
->
replstate
==
REDIS_REPL_WAIT_BGSAVE_END
)
{
if
(
slave
->
replstate
==
REDIS_REPL_WAIT_BGSAVE_END
)
{
uint64_t
j
;
uint64_t
j
;
for
(
j
=
1
;
j
<
ok_slaves
[
0
];
j
++
)
{
for
(
j
=
0
;
j
<
ok_slaves
[
0
];
j
++
)
{
if
(
slave
->
id
==
ok_slaves
[
j
])
break
;
/* Found in
the
OK list. */
if
(
slave
->
id
==
ok_slaves
[
j
+
1
])
break
;
/* Found in OK list. */
}
}
if
(
j
==
ok_slaves
[
0
])
{
if
(
j
==
ok_slaves
[
0
])
{
redisLog
(
REDIS_WARNING
,
redisLog
(
REDIS_WARNING
,
"Closing slave %llu: child->slave RDB transfer failed."
,
"Closing slave %llu: child->slave RDB transfer failed."
,
slave
->
id
);
slave
->
id
);
freeClient
(
slave
);
freeClient
(
slave
);
}
else
{
redisLog
(
REDIS_WARNING
,
"Slave %llu correctly received the streamed RDB file."
,
slave
->
id
);
}
}
}
}
}
}
...
...
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