-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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 to generate v2 snapshot from v3 state #16418
Conversation
Please take a look at the e2e failures. e.g., |
Investigation from test failure showed that the test code change was not checked in. Current diff now has the test change. Some clarifications on the test change are listed below
With the change, the test logic will replace it with integer
The reason for this update is that the new verification creates a RaftCluster object from the snapshot. It parses the member id and expects a valid id to not contain characters. If we do not update the logic for member ids as shown above, the following failure is seen
|
Overall looks good to me, with just a minor comment. |
updated as per review feedback |
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
Thank you!
@@ -250,7 +251,23 @@ func assertSnapshotsMatch(t testing.TB, firstDataDir, secondDataDir string, patc | |||
if err != nil { | |||
t.Fatal(err) | |||
} | |||
assert.Equal(t, openSnap(patch(firstSnapshot.Data)), openSnap(patch(secondSnapshot.Data))) | |||
assertMembershipEqual(t, openSnap(patch(firstSnapshot.Data)), openSnap(patch(secondSnapshot.Data))) |
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.
Why change this? Doesn't seem related changing the logic, looks like additional debug info? Could you split unrelated changes to PR?
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.
please refer to the comment above - #16418 (comment). The events on v2store and indices on v2store wont match between the two snapshots anymore
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.
The events on v2store and indices on v2store wont match between the two snapshots anymore
Not sure I understand. It's not clear from code changes. Please separate a PR that updates the test. PR should be organized in a way to clearly show what is changing, if we need to change validation, let's do that separately from business logic.
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.
Adding more clarification on the test change -
Original test was checking that the v2 snapshot content created by older and newer version matched wrt indices on the v2store and events on the v2 store. With the new logic, the indices and events on v2store will not match. As a result we saw a test failure. The test is being updated to verify membership match instead. Please let me know if you have more questions. I would like to confirm that we are on same page wrt this change in the test.
Created separate PR for test changes as per review feedback above (#16441) . The test change will need to be merged before this PR can pass. Converting this one to draft and removing the test change. The test will start failing for this PR. I will rebase this one once the test change is merged.
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.
Do not understand why we have to create a separate PR to change the validation. We only care about the membership data in the snapshot, it's reasonable to only compare the membership data.
Anyway, approved the other PR #16441.
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.
Thanks both. Separate CR was used for test code as per review feedback.
3590ce6
to
29ceb28
Compare
Please squash the commits (Note: rebase PR instead of merging main into dev branch next time). |
Signed-off-by: Geeta Gharpure <[email protected]>
updated commits |
@@ -2075,16 +2074,12 @@ func (s *EtcdServer) snapshot(snapi uint64, confState raftpb.ConfState) { | |||
// So KV().Commit() cannot run in parallel with toApply. It has to be called outside | |||
// the go routine created below. | |||
s.KV().Commit() | |||
d := GetMembershipInfoInV2Format(s.Logger(), s.cluster) |
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.
Overall note about code changes. Please avoid unnecessary reordering between functions in PR, it adds additional review strain. Like in here between s.KV().Commit()
, GetMembershipInfoInV2Format(s.Logger(), s.cluster)
. I don't think it matters here, but takes a minute or two to think about this.
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.
Created #16460 to keep the order same to simplify reasoning / avoid the unnecessary strain.
LGTM, but I would like to double check something. This change mostly depends on However I noticed that we are not testing contents of membership correctly. We confirm that members before are equal members after, however we don't really do any member changes. So there is no possibility that would allow membership to differ. Will take a look into updating the test. |
PTAL #16457 |
Validated that this PR works with #16457, so we can proceed. |
Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.
Related to #12913
e2e test is TestDowngradeUpgradeClusterOf3WithSnapshot