diff --git a/src/replication.c b/src/replication.c index d4a77b57e..07e88c151 100644 --- a/src/replication.c +++ b/src/replication.c @@ -2240,6 +2240,10 @@ void readSyncBulkPayload(connection *conn) { "disabled"); bg_unlink(server.rdb_filename); } + + /* If disk-based RDB loading fails, remove the half-loaded dataset. */ + emptyData(-1, empty_db_flags, replicationEmptyDbCallback); + /* Note that there's no point in restarting the AOF on sync failure, it'll be restarted when sync succeeds or replica promoted. */ return;