Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/util/taoserror.h
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,7 @@ int32_t taosGetErrSize();
#define TSDB_CODE_SYN_NOT_IN_RAFT_GROUP TAOS_DEF_ERROR_CODE(0, 0x0920)
#define TSDB_CODE_SYN_TERM_NOT_MATCH TAOS_DEF_ERROR_CODE(0, 0x0921)
#define TSDB_CODE_FAIL_GET_LOCK TAOS_DEF_ERROR_CODE(0, 0x0922)
#define TSDB_CODE_SYN_LEARNER_NO_VOTE TAOS_DEF_ERROR_CODE(0, 0x0923)
#define TSDB_CODE_SYN_INTERNAL_ERROR TAOS_DEF_ERROR_CODE(0, 0x09FF)


Expand Down
6 changes: 6 additions & 0 deletions source/libs/sync/src/syncRequestVote.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ int32_t syncNodeOnRequestVote(SSyncNode* ths, const SRpcMsg* pRpcMsg) {
TAOS_RETURN(TSDB_CODE_SYN_NOT_IN_RAFT_GROUP);
}

if (ths->state == TAOS_SYNC_STATE_LEARNER) {
syncLogRecvRequestVote(ths, pMsg, -1, "I'm learner", "process", &pRpcMsg->info.traceId);

TAOS_RETURN(TSDB_CODE_SYN_LEARNER_NO_VOTE);
}
Comment thread
cadem marked this conversation as resolved.

bool logOK = syncNodeOnRequestVoteLogOK(ths, pMsg);
// maybe update term
if (pMsg->term > raftStoreGetTerm(ths)) {
Expand Down
1 change: 1 addition & 0 deletions source/util/src/terror.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_SYN_WRONG_ROLE, "Sync got a wrong role
TAOS_DEFINE_ERROR(TSDB_CODE_SYN_NOT_IN_RAFT_GROUP, "Sync not in raft group")
TAOS_DEFINE_ERROR(TSDB_CODE_SYN_TERM_NOT_MATCH, "Sync term not match current term")
TAOS_DEFINE_ERROR(TSDB_CODE_FAIL_GET_LOCK, "Sync failed to get lock, will retry next time")
TAOS_DEFINE_ERROR(TSDB_CODE_SYN_LEARNER_NO_VOTE, "Sync learner cannot vote")
TAOS_DEFINE_ERROR(TSDB_CODE_SYN_INTERNAL_ERROR, "Sync internal error")

//tq
Expand Down
2 changes: 1 addition & 1 deletion test/cases/81-Tools/01-Check/test_check_error_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
'0x80000823', '0x80000824', '0x80000825', '0x80000826', '0x80000827', '0x80000828', '0x80000829', '0x8000082A', '0x8000082B', '0x8000082C',
'0x8000082D', '0x8000082E', '0x8000082F', '0x80000830', '0x80000831', '0x80000832', '0x80000833', '0x80000834', '0x80000835', '0x80000836',
'0x80000837', '0x80000838', '0x80000839', '0x80000907', '0x80000919', '0x8000091A',
'0x8000091B', '0x8000091C', '0x8000091D', '0x8000091E', '0x8000091F', '0x80000920', '0x80000921', '0x80000922', '0x80000A00',
'0x8000091B', '0x8000091C', '0x8000091D', '0x8000091E', '0x8000091F', '0x80000920', '0x80000921', '0x80000922', '0x80000923', '0x80000A00',
'0x80000A01', '0x80000A03', '0x80000A06', '0x80000A07', '0x80000A08', '0x80000A09', '0x80000A0A', '0x80000A0B', '0x80000A0E', '0x80002206',
'0x80002207', '0x80002406', '0x80002407', '0x80002503', '0x80002506', '0x80002507', '0x8000261B', '0x80002653', '0x80002668', '0x80002669',
'0x8000266A', '0x8000266B', '0x8000266C', '0x8000266D', '0x8000266E', '0x8000266F', '0x80002670', '0x80002671', '0x80002672', '0x80002673',
Expand Down
Loading