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
b3408e9a
Commit
b3408e9a
authored
Mar 21, 2019
by
antirez
Browse files
More sensible name for function: restartAOFAfterSYNC().
Related to #3829.
parent
9588fd52
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/replication.c
View file @
b3408e9a
...
...
@@ -1090,7 +1090,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;
...
...
@@ -1289,7 +1293,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 */
...
...
@@ -1314,7 +1318,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