-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(OraklNode) Track peers manually #1572
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe recent changes enhance the Raft consensus algorithm in the Changes
Sequence Diagram(s)sequenceDiagram
participant Leader
participant Follower
participant Raft
participant Peers
Leader->>Raft: sendHeartbeat()
Raft->>Peers: Update Peers Set
Raft->>Follower: sendReplyHeartbeat()
Follower->>Raft: handleReplyHeartbeat()
Raft->>Leader: Acknowledge Heartbeat
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
@coderabbitai review |
Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- node/pkg/raft/accessors.go (2 hunks)
- node/pkg/raft/raft.go (7 hunks)
- node/pkg/raft/types.go (4 hunks)
- node/pkg/utils/set/set.go (1 hunks)
- node/pkg/utils/tests/set_test.go (1 hunks)
Files skipped from review due to trivial changes (1)
- node/pkg/utils/set/set.go
Additional comments not posted (2)
node/pkg/raft/types.go (1)
24-24
: Addition ofReplyHeartbeat
type and related struct.Ensure that all new types are properly used and integrated in message handling.
Also applies to: 46-47
Verification successful
The
ReplyHeartbeatMessage
type is defined and instantiated innode/pkg/raft/types.go
andnode/pkg/raft/raft.go
. Additionally, it is used in JSON unmarshalling and marshalling operations, indicating its integration into the message handling logic.
node/pkg/raft/raft.go
:
- Line:
var replyHeartbeatMessage ReplyHeartbeatMessage
- Line:
err := json.Unmarshal(msg.Data, &replyHeartbeatMessage)
- Line:
replyHeartbeatMessage := ReplyHeartbeatMessage{}
- Line:
marshalledReplyHeartbeatMsg, err := json.Marshal(replyHeartbeatMessage)
These usages confirm that
ReplyHeartbeatMessage
is being properly handled in the message processing flow.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `ReplyHeartbeatMessage` across the system. # Test: Search for the instantiation and handling of `ReplyHeartbeatMessage`. Expect: Proper usage in message handling. rg --type go $'ReplyHeartbeatMessage'Length of output: 238
Script:
#!/bin/bash # Description: Verify the usage of `replyHeartbeatMessage` in message handling. # Test: Search for the usage of `replyHeartbeatMessage` in the context of message handling. rg --type go 'replyHeartbeatMessage'Length of output: 353
node/pkg/raft/raft.go (1)
111-112
: Handling ofReplyHeartbeat
messages and peer set management.Ensure thorough testing of these new functionalities to maintain system stability.
Also applies to: 119-121, 163-163, 228-237
* feat: default to udp - quic * test: prevent possible duplicate port err * test: fix port error * test: fix test err * fix: remove listen port, add missing `HOST_IP` reference * fix: rollback listen port * fix: update based on feedback
…among peers (#1571) * wip * fix: vet err * fix: update based on feedbacks * fix: remove boot api property for testing purpose * feat: boot api follow previous behavior * (OraklNode) Track peers manually (#1572) * feat: implement peer count into raft pkg * fix: remove unused property * test: add cases to test based on feedback * (OraklNode) Default to udp - quic (#1573) * feat: default to udp - quic * test: prevent possible duplicate port err * test: fix port error * test: fix test err * fix: remove listen port, add missing `HOST_IP` reference * fix: rollback listen port * fix: update based on feedback
Description
Track cluster peers manually instead of using built in function pubsub.ListPeers
Type of change
Please delete options that are not relevant.
Checklist before requesting a review
Deployment