Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dgraph
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
dgraph
Commits
351c15fd
Unverified
Commit
351c15fd
authored
6 years ago
by
Manish R Jain
Browse files
Options
Downloads
Patches
Plain Diff
Avoid leader change in case of a node rejoining the cluster by using PreVote.
parent
85fc758c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
conn/node.go
+16
-7
16 additions, 7 deletions
conn/node.go
with
16 additions
and
7 deletions
conn/node.go
+
16
−
7
View file @
351c15fd
...
@@ -74,14 +74,23 @@ func NewNode(rc *intern.RaftContext, store *raftwal.DiskStorage) *Node {
...
@@ -74,14 +74,23 @@ func NewNode(rc *intern.RaftContext, store *raftwal.DiskStorage) *Node {
MaxSizePerMsg
:
256
<<
10
,
MaxSizePerMsg
:
256
<<
10
,
MaxInflightMsgs
:
256
,
MaxInflightMsgs
:
256
,
Logger
:
&
raft
.
DefaultLogger
{
Logger
:
x
.
Logger
},
Logger
:
&
raft
.
DefaultLogger
{
Logger
:
x
.
Logger
},
// We don't need lease based reads. They cause issues because they require CheckQuorum
// We don't need lease based reads. They cause issues because they
// to be true, and that causes a lot of issues for us during cluster bootstrapping and
// require CheckQuorum to be true, and that causes a lot of issues
// later. A seemingly healthy cluster would just cause leader to step down due to
// for us during cluster bootstrapping and later. A seemingly
// "inactive" quorum, and then disallow anyone from becoming leader. So, let's stick to
// healthy cluster would just cause leader to step down due to
// default options. Let's achieve correctness, then we achieve performance. Plus, for
// "inactive" quorum, and then disallow anyone from becoming leader.
// the Dgraph servers, we'll be soon relying only on Timestamps for blocking reads and
// So, let's stick to default options. Let's achieve correctness,
// achieving linearizability, than checking quorums (Zero would still check quorums).
// then we achieve performance. Plus, for the Dgraph servers, we'll
// be soon relying only on Timestamps for blocking reads and
// achieving linearizability, than checking quorums (Zero would
// still check quorums).
ReadOnlyOption
:
raft
.
ReadOnlySafe
,
ReadOnlyOption
:
raft
.
ReadOnlySafe
,
// When a disconnected node joins back, it forces a leader change,
// as it starts with a higher term, as described in Raft thesis (not
// the paper) in section 9.6. This setting can avoid that by only
// increasing the term, if the node has a good chance of becoming
// the leader.
PreVote
:
true
,
},
},
// processConfChange etc are not throttled so some extra delta, so that we don't
// processConfChange etc are not throttled so some extra delta, so that we don't
// block tick when applyCh is full
// block tick when applyCh is full
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment