diff options
author | Salvatore Sanfilippo <antirez@gmail.com> | 2019-09-26 11:52:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-26 11:52:42 +0200 |
commit | 959fb5cf6879c5fb04e8fcf00efda4816e358d0d (patch) | |
tree | b5f35d85bb5ac3b60e30731cd602317915c9e616 /src/replication.c | |
parent | b0a90d8fa825bdc35982529c97ebe316cdca0161 (diff) | |
parent | 40c4183196b8c6e1c44c27400965786b9f010c74 (diff) | |
download | redis-959fb5cf6879c5fb04e8fcf00efda4816e358d0d.tar.gz |
Merge pull request #6235 from oranagra/module_rdb_load_errors
Allow modules to handle RDB loading errors.
Diffstat (limited to 'src/replication.c')
-rw-r--r-- | src/replication.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/replication.c b/src/replication.c index d6646c9ef..bb4287b62 100644 --- a/src/replication.c +++ b/src/replication.c @@ -1139,8 +1139,15 @@ 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()) { + serverLog(LL_WARNING, + "Skipping diskless-load because there are modules that don't handle read errors."); + enabled = 0; + } + return enabled; } /* Helper function for readSyncBulkPayload() to make backups of the current |