MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / restartAOFAfterSYNC

Function restartAOFAfterSYNC

src/replication.cpp:2422–2437  ·  view source on GitHub ↗

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. */

Source from the content-addressed store, hash-verified

2420 * the replica cannot be considered reliable and exists with an
2421 * error. */
2422void restartAOFAfterSYNC() {
2423 unsigned int tries, max_tries = 10;
2424 for (tries = 0; tries < max_tries; ++tries) {
2425 if (startAppendOnly() == C_OK) break;
2426 serverLog(LL_WARNING,
2427 "Failed enabling the AOF after successful master synchronization! "
2428 "Trying it again in one second.");
2429 sleep(1);
2430 }
2431 if (tries == max_tries) {
2432 serverLog(LL_WARNING,
2433 "FATAL: this replica instance finished the synchronization with "
2434 "its master, but the AOF can't be turned on. Exiting now.");
2435 exit(1);
2436 }
2437}
2438
2439static int useDisklessLoad() {
2440 /* compute boolean decision to use diskless load */

Callers 3

readSyncBulkPayloadFunction · 0.85
replicationUnsetMasterFunction · 0.85
RM_ResetDatasetFunction · 0.85

Calls 2

startAppendOnlyFunction · 0.85
serverLogFunction · 0.85

Tested by

no test coverage detected