summaryrefslogtreecommitdiff
path: root/src/replication.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/replication.c')
-rw-r--r--src/replication.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/replication.c b/src/replication.c
index 26e7cf8f0..14ae2f96c 100644
--- a/src/replication.c
+++ b/src/replication.c
@@ -1115,8 +1115,12 @@ void restartAOFAfterSYNC() {
static int useDisklessLoad() {
/* compute boolean decision to use diskless load */
- return server.repl_diskless_load == REPL_DISKLESS_LOAD_SWAPDB ||
+ int enabled = server.repl_diskless_load == REPL_DISKLESS_LOAD_SWAPDB ||
(server.repl_diskless_load == REPL_DISKLESS_LOAD_WHEN_DB_EMPTY && dbTotalServerKeyCount()==0);
+ /* Check all modules handle read errors, otherwise it's not safe to use diskless load. */
+ if (enabled && !moduleAllDatatypesHandleErrors())
+ enabled = 0;
+ return enabled;
}
/* Helper function for readSyncBulkPayload() to make backups of the current