| 1504 | } |
| 1505 | |
| 1506 | static int useDisklessLoad() { |
| 1507 | /* compute boolean decision to use diskless load */ |
| 1508 | int enabled = server.repl_diskless_load == REPL_DISKLESS_LOAD_SWAPDB || |
| 1509 | (server.repl_diskless_load == REPL_DISKLESS_LOAD_WHEN_DB_EMPTY && dbTotalServerKeyCount()==0); |
| 1510 | /* Check all modules handle read errors, otherwise it's not safe to use diskless load. */ |
| 1511 | if (enabled && !moduleAllDatatypesHandleErrors()) { |
| 1512 | serverLog(LL_WARNING, |
| 1513 | "Skipping diskless-load because there are modules that don't handle read errors."); |
| 1514 | enabled = 0; |
| 1515 | } |
| 1516 | return enabled; |
| 1517 | } |
| 1518 | |
| 1519 | /* Helper function for readSyncBulkPayload() to make backups of the current |
| 1520 | * databases before socket-loading the new ones. The backups may be restored |
no test coverage detected