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

fix(coordinator): choose highest term and entry node as leader #579

Merged
merged 2 commits into from
Nov 16, 2024

Conversation

mattisonchao
Copy link
Member

@mattisonchao mattisonchao commented Nov 16, 2024

Motivation

Follow the TLA+. We should choose the highest term entry node as the leader, which can also fix the issue we encountered.

{"level":"info","time":"2024-11-14T01:04:55.195566194Z","component":"shard-controller","namespace":"xxx","shard":10,"term":278,"time":"2024-11-14T01:04:55.195588258Z","message":"Starting leader election"}
{"level":"info","time":"2024-11-14T01:04:55.218118449Z","component":"shard-controller","entry-id":{"term":"78","offset":"5652112"},"namespace":"xxx","server-address":{"public":"xxxxxxx:6648","internal":"xxxxxxx:6649"},"shard":10,"time":"2024-11-14T01:04:55.218152924Z","message":"Processed newTerm response"}
{"level":"info","time":"2024-11-14T01:04:55.218347701Z","component":"shard-controller","entry-id":{"term":"78","offset":"5652112"},"namespace":"xxx","server-address":{"public":"xxxxxxx:6648","internal":"xxxxxxx:6649"},"shard":10,"time":"2024-11-14T01:04:55.218369944Z","message":"Processed newTerm response"}
{"level":"info","time":"2024-11-14T01:04:55.219517988Z","component":"shard-controller","entry-id":{"term":"77","offset":"5653106"},"namespace":"xxx","server-address":{"public":"xxxxxxx:6648","internal":"xxxxxxx:6649"},"shard":10,"time":"2024-11-14T01:04:55.219534113Z","message":"Processed newTerm response"}
{"level":"info","time":"2024-11-14T01:04:55.219554195Z","component":"shard-controller","followers":[{"server-address":{"public":"xxxxxxx:6648","internal":"xxxxxxx:6649"},"entry-id":{"term":78,"offset":5652112}},{"server-address":{"public":"xxxxxxx:6648","internal":"xxxxxxx:6649"},"entry-id":{"term":78,"offset":5652112}}],"namespace":"xxx","new-leader":{"public":"xxxxxxx:6648","internal":"xxxxxxx:6649"},"shard":10,"term":278,"time":"2024-11-14T01:04:55.219564969Z","message":"Successfully moved ensemble to a new term"}

@mattisonchao mattisonchao merged commit 02d3f5c into main Nov 16, 2024
7 checks passed
@mattisonchao mattisonchao deleted the fix.election.term branch November 16, 2024 03:53
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

Successfully merging this pull request may close these issues.

2 participants