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

Add a config option specifying no snapshot restore on startup #340

Merged
merged 2 commits into from
Jul 19, 2019

Conversation

briankassouf
Copy link
Contributor

No description provided.

Copy link
Member

@hanshasselberg hanshasselberg left a comment

Choose a reason for hiding this comment

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

I left two comments about the same thing. And I guess the answer will also account for my last question: why isn't the whole RecoverCluster function executed conditionally. It seems like we don't restore snapshots, but still apply their metadata?


r.logger.Info(fmt.Sprintf("Restored from snapshot %v", snapshot.ID))
}
// Update the lastApplied so we don't replay old logs
r.setLastApplied(snapshot.Index)
Copy link
Member

Choose a reason for hiding this comment

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

Is it correct to leave this here since nothing was actually restored?

if err != nil {
// Same here, skip and try the next one.
continue
}
}

snapshotIndex = snapshot.Index
Copy link
Member

Choose a reason for hiding this comment

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

Is it correct to leave this here since nothing was actually restored?

@briankassouf
Copy link
Contributor Author

@i0rek Good question, yeah we still need a way to tell Raft which index the FSM is currently at even if we don't need to restore a snapshot to the FSM. This way if there are still pending logs they will be replayed on top of the FSM. The Snapshot Metadata is still used to do this. In Vault's case the snapshot metadata represents the current state of the FSM.

@jefferai
Copy link
Member

Test failure just normal flakiness; merging.

@jefferai jefferai merged commit dcbf305 into master Jul 19, 2019
@jefferai jefferai deleted the no-restore-on-start branch July 19, 2019 14:35
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.

3 participants