Merge pull request #14037 from taosdata/feature/3.0_mhli

fix(sync): set standby when not follower
This commit is contained in:
Li Minghao 2022-06-21 09:41:32 +08:00 committed by GitHub
commit 4cacb51efa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}