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. */
| 2420 | * the replica cannot be considered reliable and exists with an |
| 2421 | * error. */ |
| 2422 | void 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 | |
| 2439 | static int useDisklessLoad() { |
| 2440 | /* compute boolean decision to use diskless load */ |
no test coverage detected