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
7e350b09
Commit
7e350b09
authored
Mar 21, 2019
by
antirez
Browse files
More sensible name for function: restartAOFAfterSYNC().
Related to #3829.
parent
91238a60
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/replication.c
View file @
7e350b09
...
...
@@ -1089,7 +1089,11 @@ void replicationCreateMasterClient(int fd, int dbid) {
if
(
dbid
!=
-
1
)
selectDb
(
server
.
master
,
dbid
);
}
void
restartAOF
()
{
/* This function will try to re-enable the AOF file after the
* master-replica synchronization: if it fails after multiple attempts
* the replica cannot be considered reliable and exists with an
* error. */
void
restartAOFAfterSYNC
()
{
unsigned
int
tries
,
max_tries
=
10
;
for
(
tries
=
0
;
tries
<
max_tries
;
++
tries
)
{
if
(
startAppendOnly
()
==
C_OK
)
break
;
...
...
@@ -1288,7 +1292,7 @@ void readSyncBulkPayload(aeEventLoop *el, int fd, void *privdata, int mask) {
cancelReplicationHandshake
();
/* Re-enable the AOF if we disabled it earlier, in order to restore
* the original configuration. */
if
(
aof_is_enabled
)
restartAOF
();
if
(
aof_is_enabled
)
restartAOF
AfterSYNC
();
return
;
}
/* Final setup of the connected slave <- master link */
...
...
@@ -1313,7 +1317,7 @@ void readSyncBulkPayload(aeEventLoop *el, int fd, void *privdata, int mask) {
/* Restart the AOF subsystem now that we finished the sync. This
* will trigger an AOF rewrite, and when done will start appending
* to the new file. */
if
(
aof_is_enabled
)
restartAOF
();
if
(
aof_is_enabled
)
restartAOF
AfterSYNC
();
}
return
;
...
...
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