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

VAULT-23553: Revert "Don't panic on unknown raft ops" #25991

Merged
merged 8 commits into from
Mar 19, 2024

Conversation

miagilepner
Copy link
Contributor

This PR reverts the change as part of undo logs, and adds a test to verify that an unknown operation will panic.

@miagilepner miagilepner requested a review from raskchanky March 18, 2024 15:36
@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Mar 18, 2024
@miagilepner miagilepner added this to the 1.17.0 milestone Mar 18, 2024
Copy link

github-actions bot commented Mar 18, 2024

CI Results:
All Go tests succeeded! ✅

@@ -678,24 +677,24 @@ func (f *FSM) ApplyBatch(logs []*raft.Log) []interface{} {
// Do the unmarshalling first so we don't hold locks
var latestConfiguration *ConfigurationValue
commands := make([]interface{}, 0, numLogs)
for _, l := range logs {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: I have a very mild preference that variable names not shadow package names, just for the sake of readability, which is why I changed all these log references in the original PR. Not a big deal by any means.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to l

@miagilepner miagilepner marked this pull request as ready for review March 18, 2024 16:26
Copy link

Build Results:
All builds succeeded! ✅

r := recover()
require.NotNil(t, r)
require.Contains(t, r, "failed to store data")
}()
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a very cool trick! I didn't know you could do that.

Copy link
Collaborator

@raskchanky raskchanky left a comment

Choose a reason for hiding this comment

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

Looks awesome! Thanks for doing this!

@miagilepner miagilepner merged commit b01ba81 into main Mar 19, 2024
83 checks passed
@miagilepner miagilepner deleted the miagilepner/VAULT-23553-fsm-dataloss branch March 19, 2024 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants