[release-3.5] enhance etcdutl check v2store to check both v2 snapshot and WAL records#21889
[release-3.5] enhance etcdutl check v2store to check both v2 snapshot and WAL records#21889silentred wants to merge 3 commits into
etcdutl check v2store to check both v2 snapshot and WAL records#21889Conversation
ahrtr
left a comment
There was a problem hiding this comment.
Overall looks good, thx
Note we also need to update the v3.5 -> v3.6 upgrade guide, https://etcd.io/docs/v3.6/upgrades/upgrade_3_6/
| if err := assertNoV2StoreContent(st); err != nil { | ||
| return err | ||
| } |
There was a problem hiding this comment.
We need to continue to check WAL files. We need to provide output something like below,
case 1: neither v2 snapshot nor WAL file have custom v2 content
No custom content found in v2store.
case 2: only v2 snapshot file has custom v2 content
detected custom content in v2store
In this case, users can either remove the v2 content from v2store, or just set --v2-deprecation=write-only-skip-check. Refer to #21850
I think we need to backport #21848 to release-3.5 as well. In this case, users can set --v2-deprecation=write-only-skip-check when they are still on v3.5, and then upgrade to v3.6; otherwise they can only add this option after moving to v3.6, but the upgrade may have already failed.
case 3: only WAL files have custom v2 content
detected custom v2 content in WAL records
In this case, users can perform the workaround as documented in the first section "v2 store" in https://etcd.io/docs/v3.6/upgrades/upgrade_3_6/.
case 4: both v2 snapshot and WAL record have custom v2 content
detected custom v2 content in both v2store and WAL records
In this case, In this case, users need to perform the same workaround as case 2 mentioned above, and also the workaround as documented in the first section "v2 store" in https://etcd.io/docs/v3.6/upgrades/upgrade_3_6/
There was a problem hiding this comment.
The error message for case 1 should be something like No custom content found in both v2store and WAL records.
There was a problem hiding this comment.
Noted. I will revise the code according to your doc.
74319af to
a28de3b
Compare
There was a problem hiding this comment.
This isn't correct. When there is no snapshot, we load all WAL records.
There was a problem hiding this comment.
Updated. Trying to fix e2e tests.
43f69e5 to
7893963
Compare
|
LGTM with a minor comment. Can you please also manually verify all the scenarios and show us the results? |
etcdutl check v2store to check both v2 snapshot and WAL records
Signed-off-by: shenmu.wy <shenmu.wy@antfin.com>
Signed-off-by: shenmu.wy <shenmu.wy@antfin.com>
19bfec4 to
64612fb
Compare
I have added two e2e tests to cover the 2nd and 3rd cases. Combined with the existing |
| for _, m := range matches { | ||
| require.NoError(t, os.Remove(m)) | ||
| t.Logf("Removed v2 snapshot: %s", m) | ||
| } |
There was a problem hiding this comment.
do we need to remove the v2snapshot files? There should be no v2 snapshot files at all?
There was a problem hiding this comment.
There should be no .snap files at all. I removed this block of code.
| assert.NoError(t, err) | ||
| } | ||
|
|
||
| // TestCtlV2CustomContentOnlyV2Store exercises case 2: a v2 snapshot with |
There was a problem hiding this comment.
Other contributors do not know what's case 2 or case 3, pls either add a link (below) to the comment or remove it.
There was a problem hiding this comment.
Updated the comment.
| assert.NoError(t, err) | ||
| } | ||
|
|
||
| // TestCtlV2CustomContentOnlyWAL exercises case 3: a v2 PUT is recorded in |
64612fb to
11f580e
Compare
|
etcd/tests/e2e/v2store_deprecation_test.go Lines 185 to 186 in 9fa3224 this error may be "read /dev/ptmx: input/output error" Examples: |
|
/retest |
|
Both errors seem related to the test case itself. I see that the |
Signed-off-by: shenmu.wy <shenmu.wy@antfin.com>
11f580e to
eebec78
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahrtr, silentred The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
ping @fuweid |
I've given it a try to resolve #21849, but haven't added tests yet. Could you take a look and see if the fix is heading in the right direction?
cc @ahrtr