Skip to content
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

TestMultipleNodes #14

Open
SeatSnobAri opened this issue Sep 15, 2022 · 2 comments
Open

TestMultipleNodes #14

SeatSnobAri opened this issue Sep 15, 2022 · 2 comments

Comments

@SeatSnobAri
Copy link

Hey im working through the book. I've been stuck debugging the coordinate your services with consensus test.

    distributed_test.go:50: 
                Error Trace:    /Users/arishaller/proglog/internal/log/distributed_test.go:50
                Error:          Received unexpected error:
                                node is not the leader
                Test:           TestMultipleNodes
FAIL
2022-09-15T11:52:01.697-0400 [DEBUG] raft: calculated votes needed: needed=2 term=3
2022-09-15T11:52:01.697-0400 [DEBUG] raft: vote granted: from=0 term=3 tally=1
2022-09-15T11:52:01.697-0400 [DEBUG] raft: lost leadership because received a requestVote with a newer term
@SeatSnobAri
Copy link
Author

2022-09-15T11:52:01.370-0400 [INFO]  raft: added peer, starting replication: peer=1
2022-09-15T11:52:01.421-0400 [WARN]  raft: failed to contact: server-id=1 time=51.047208ms
2022-09-15T11:52:01.421-0400 [WARN]  raft: failed to contact quorum of nodes, stepping down
2022-09-15T11:52:01.421-0400 [INFO]  raft: entering follower state: follower="Node at 127.0.0.1:20241 [Follower]" leader-address= leader-id=
2022-09-15T11:52:01.463-0400 [WARN]  raft: failed to get previous log: previous-index=3 last-index=0 error="rpc error: code = Code(404) desc = offet out of range 3"
2022-09-15T11:52:01.464-0400 [WARN]  raft: no known peers, aborting election
2022-09-15T11:52:01.465-0400 [WARN]  raft: appendEntries rejected, sending older logs: peer="{Voter 1 127.0.0.1:20242}" next=1
2022-09-15T11:52:01.504-0400 [WARN]  raft: heartbeat timeout reached, starting election: last-leader-addr= last-leader-id=
2022-09-15T11:52:01.504-0400 [INFO]  raft: entering candidate state: node="Node at 127.0.0.1:20241 [Candidate]" term=3
2022-09-15T11:52:01.587-0400 [DEBUG] raft: voting for self: term=3 id=0
2022-09-15T11:52:01.643-0400 [INFO]  raft: initial configuration: index=0 servers=[]
2022-09-15T11:52:01.643-0400 [INFO]  raft: entering follower state: follower="Node at 127.0.0.1:20243 [Follower]" leader-address= leader-id=

@yongsheng1992
Copy link

It maybe seems that raft cluster has not elected a leader successuly within the time duration. Maybe you can set the require.Eventually ‘s param waitFor longger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants