From 55cc6f797a9179c393b7e6651eadfc8b457d1c9b Mon Sep 17 00:00:00 2001 From: malavan Date: Fri, 26 Nov 2021 17:46:41 +0000 Subject: [PATCH] client lock for fast sync replbuffer, delay fast sync for next replication cron Former-commit-id: 9fe7f8328d66f9ec57060934462ad85ef60c36aa --- src/replication.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/replication.cpp b/src/replication.cpp index c55617cba..d99346a57 100644 --- a/src/replication.cpp +++ b/src/replication.cpp @@ -975,6 +975,7 @@ public: aeAcquireLock(); } + std::unique_lock lock(replica->lock); addReplyProto(replica, reply->buf(), reply->used); } ProcessPendingAsyncWrites(); @@ -1380,7 +1381,7 @@ void syncCommand(client *c) { /* CASE 0: Fast Sync */ if ((c->slave_capa & SLAVE_CAPA_ROCKSDB_SNAPSHOT) && g_pserver->m_pstorageFactory) { - startBgsaveForReplication(c->slave_capa); + serverLog(LL_NOTICE,"Fast SYNC on next replication cycle"); /* CASE 1: BGSAVE is in progress, with disk target. */ } else if (g_pserver->FRdbSaveInProgress() && g_pserver->rdb_child_type == RDB_CHILD_TYPE_DISK)