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

Function useDisklessLoad

src/replication.cpp:2439–2450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2437}
2438
2439static 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

Callers 2

readSyncBulkPayloadRdbFunction · 0.85
syncWithMasterFunction · 0.85

Calls 3

dbTotalServerKeyCountFunction · 0.85
serverLogFunction · 0.85

Tested by

no test coverage detected