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

Update RAFT checkpoint when doing a clean shutdown. #5097

Merged
merged 4 commits into from Apr 7, 2020

Conversation

martinmr
Copy link
Contributor

@martinmr martinmr commented Apr 3, 2020

This will prevent the write ahead log from being replayed after the restart of the server.


This change is Reviewable

@martinmr martinmr requested review from manishrjain and a team as code owners April 3, 2020 18:49
Copy link
Contributor

@manishrjain manishrjain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @manishrjain and @martinmr)


dgraph/cmd/alpha/run.go, line 509 at r1 (raw file):

		// Update checkpoint so that proposals are not replayed after the server restarts.
		if err := worker.UpdateRaftProgress(); err != nil {

This should be moved to worker.BlockingStop in worker.go.

Copy link
Contributor Author

@martinmr martinmr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @manishrjain)


dgraph/cmd/alpha/run.go, line 509 at r1 (raw file):

Previously, manishrjain (Manish R Jain) wrote…

This should be moved to worker.BlockingStop in worker.go.

Done.

Copy link
Contributor

@manishrjain manishrjain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: Got a comment.

Reviewed 2 of 3 files at r2.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @manishrjain and @martinmr)


worker/worker.go, line 114 at r2 (raw file):

	// Update checkpoint so that proposals are not replayed after the server restarts.
	glog.Infof("Updating RAFT state before shutting down...")
	if err := groups().Node.updateRaftProgress(); err != nil {

Might check and see if we need to move this after groups.closer (still keep it before node closer).

@martinmr martinmr merged commit 98769a6 into master Apr 7, 2020
@martinmr martinmr deleted the martinmr/shutdown-checkpoint branch April 7, 2020 21:34
dna2github pushed a commit to dna2fork/dgraph that referenced this pull request Jul 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants