mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
More sensible name for function: restartAOFAfterSYNC().
Related to #3829.
This commit is contained in:
parent
9588fd52ac
commit
b3408e9a9b
@ -1090,7 +1090,11 @@ void replicationCreateMasterClient(int fd, int dbid) {
|
|||||||
if (dbid != -1) selectDb(server.master,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;
|
unsigned int tries, max_tries = 10;
|
||||||
for (tries = 0; tries < max_tries; ++tries) {
|
for (tries = 0; tries < max_tries; ++tries) {
|
||||||
if (startAppendOnly() == C_OK) break;
|
if (startAppendOnly() == C_OK) break;
|
||||||
@ -1289,7 +1293,7 @@ void readSyncBulkPayload(aeEventLoop *el, int fd, void *privdata, int mask) {
|
|||||||
cancelReplicationHandshake();
|
cancelReplicationHandshake();
|
||||||
/* Re-enable the AOF if we disabled it earlier, in order to restore
|
/* Re-enable the AOF if we disabled it earlier, in order to restore
|
||||||
* the original configuration. */
|
* the original configuration. */
|
||||||
if (aof_is_enabled) restartAOF();
|
if (aof_is_enabled) restartAOFAfterSYNC();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* Final setup of the connected slave <- master link */
|
/* 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
|
/* Restart the AOF subsystem now that we finished the sync. This
|
||||||
* will trigger an AOF rewrite, and when done will start appending
|
* will trigger an AOF rewrite, and when done will start appending
|
||||||
* to the new file. */
|
* to the new file. */
|
||||||
if (aof_is_enabled) restartAOF();
|
if (aof_is_enabled) restartAOFAfterSYNC();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user