Open
Conversation
Co-authored-by: Copilot <copilot@github.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a new error code, TSDB_CODE_SYN_LEARNER_NO_VOTE, and implements a check in the syncNodeOnRequestVote function to ensure that nodes in the learner state do not participate in voting. The error code is defined in both the header and the error string mapping files. I have no feedback to provide.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent Raft learner nodes from participating in leader elections by rejecting RequestVote handling when a node is in TAOS_SYNC_STATE_LEARNER.
Changes:
- Add a new sync error code
TSDB_CODE_SYN_LEARNER_NO_VOTE. - Reject
RequestVoteprocessing when the receiver node is in learner state. - Register the new error code in the central error string table.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| source/util/src/terror.c | Adds the human-readable string for TSDB_CODE_SYN_LEARNER_NO_VOTE. |
| include/util/taoserror.h | Defines the numeric value for the new sync error code. |
| source/libs/sync/src/syncRequestVote.c | Adds a learner-state guard to avoid voting during RequestVote processing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Issue(s)
Checklist
Please check the items in the checklist if applicable.