Skip to content

fix(snapshot): Fix snapshot calculation after restore #8024

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

Merged
merged 3 commits into from
Sep 15, 2021

Conversation

ahsanbarkati
Copy link
Contributor

@ahsanbarkati ahsanbarkati commented Sep 14, 2021

If there is no delta proposal with a valid commit then the snapshot was
skipped. For the purpose of snapshot calculation, we should also
consider the restore timestamp.


This change is Reviewable

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 1 files reviewed, 2 unresolved discussions (waiting on @ahsanbarkati)


worker/draft.go, line 2045 at r1 (raw file):

			// purpose of snapshot calculation.
			if proposal.Restore != nil {
				restoreTs := proposal.Restore.GetRestoreTs()

If we did a restore, then we should just overwrite the timestamp to use the restore timestamp. But, does the restore TS get correctly picked up?

worker/draft.go Outdated
// a snapshot. This is to avoid the restore happening again if the server restarts.
if proposal.Restore != nil {
restoreTs := proposal.Restore.GetRestoreTs()
glog.Infof("Found restore proposal with restoreTs: %d", restoreTs)
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a log like calculated snapshot from the restore proposal and maybe dump the snapshot as well in the logs?

Copy link
Contributor

@NamanJain8 NamanJain8 left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@ahsanbarkati ahsanbarkati merged commit 93e31cc into master Sep 15, 2021
@ahsanbarkati ahsanbarkati deleted the ahsan/fix-snapshot branch September 15, 2021 16:08
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.

3 participants