From 3b7e0bfdccca787257055bbae92a978795007ed0 Mon Sep 17 00:00:00 2001 From: Minghao Li Date: Mon, 20 Jun 2022 20:55:40 +0800 Subject: [PATCH] fix(sync): set standby when not follower --- source/libs/sync/src/syncMain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/libs/sync/src/syncMain.c b/source/libs/sync/src/syncMain.c index 599410510d..33e7a8241f 100644 --- a/source/libs/sync/src/syncMain.c +++ b/source/libs/sync/src/syncMain.c @@ -154,10 +154,10 @@ int32_t syncSetStandby(int64_t rid) { return -1; } - if (pSyncNode->state == TAOS_SYNC_STATE_LEADER) { + if (pSyncNode->state != TAOS_SYNC_STATE_FOLLOWER) { taosReleaseRef(tsNodeRefId, pSyncNode->rid); terrno = TSDB_CODE_SYN_IS_LEADER; - sError("failed to set standby since it is leader, rid:%" PRId64, rid); + sError("failed to set standby since it is not follower, rid:%" PRId64, rid); return -1; }