From b666962ed83d0870cc96b90b00a158dbf176c3d7 Mon Sep 17 00:00:00 2001 From: John Sully Date: Fri, 12 Nov 2021 00:18:32 +0000 Subject: [PATCH] Allow fast sync even if a background save is in progress Former-commit-id: b98aadfb6875f366a63a9d27d47fb5ca60abaa03 --- src/replication.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/replication.cpp b/src/replication.cpp index 3651b0113..2618a605f 100644 --- a/src/replication.cpp +++ b/src/replication.cpp @@ -1385,8 +1385,11 @@ void syncCommand(client *c) { g_pserver->replid, g_pserver->replid2); } + /* CASE 0: Fast Sync */ + if ((c->slave_capa & SLAVE_CAPA_ROCKSDB_SNAPSHOT) && g_pserver->m_pstorageFactory) { + startBgsaveForReplication(c->slave_capa); /* CASE 1: BGSAVE is in progress, with disk target. */ - if (g_pserver->FRdbSaveInProgress() && + } else if (g_pserver->FRdbSaveInProgress() && g_pserver->rdb_child_type == RDB_CHILD_TYPE_DISK) { /* Ok a background save is in progress. Let's check if it is a good