| 2437 | } |
| 2438 | |
| 2439 | static int useDisklessLoad() { |
| 2440 | /* compute boolean decision to use diskless load */ |
| 2441 | int enabled = g_pserver->repl_diskless_load == REPL_DISKLESS_LOAD_SWAPDB || |
| 2442 | (g_pserver->repl_diskless_load == REPL_DISKLESS_LOAD_WHEN_DB_EMPTY && dbTotalServerKeyCount()==0); |
| 2443 | /* Check all modules handle read errors, otherwise it's not safe to use diskless load. */ |
| 2444 | if (enabled && !moduleAllDatatypesHandleErrors()) { |
| 2445 | serverLog(LL_WARNING, |
| 2446 | "Skipping diskless-load because there are modules that don't handle read errors."); |
| 2447 | enabled = 0; |
| 2448 | } |
| 2449 | return enabled; |
| 2450 | } |
| 2451 | |
| 2452 | /* Helper function for readSyncBulkPayload() to make backups of the current |
| 2453 | * databases before socket-loading the new ones. The backups may be restored |
no test coverage detected