-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat(Flags): [Breaking] Add flag for snapshot duration frequency #7675
Conversation
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.
Some minor comments. Otherwise, looks good.
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.
Reviewed 3 of 4 files at r1, 1 of 1 files at r2.
Reviewable status: all files reviewed, 6 unresolved discussions (waiting on @NamanJain8, @rohanprasad, and @vvbalaji-dgraph)
dgraph/cmd/alpha/run.go, line 161 at r2 (raw file):
`Make this Alpha a "learner" node. In learner mode, this Alpha will not participate `+ "in Raft elections. This can be used to achieve a read-only replica."). Flag("snapshot-after-entries",
Just keep both for now. But, make it an AND. Both conditions must be true.
dgraph/cmd/alpha/run.go, line 166 at r2 (raw file):
"snapshot-after-duration or snapshot-after-entries threshold is crossed."). Flag("snapshot-after-duration", "Frequency at which we should create a new raft snapshots. Set "+
No need to repeat that "snapshots are created ...". Explain the format of duration -- 30m, 2h, ... Or, if it's in the help, then it's good.
snapshot-after
worker/draft.go, line 1000 at r2 (raw file):
func (n *node) checkpointAndClose(done chan struct{}) { slowTicker := time.NewTicker(time.Minute) lastSnapshotTime := time.Now()
just keep this in memory.
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.
LGTM.
Few nit-picks. Otherwise, looks fine.
* Add flag for snapshot duration frequency * Use both entries and duration based flags for snapshots
Add a new flag snapshot-after-duration, which will take duration as a value. Raft snapshots will now be taken based on time since the last snapshot or the number of new raft entries. Also, rename snapshot-after to snapshot-after-entries for distinction.
Fixes DGRAPH-3213
This change is