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

[3.5] Add online & offline commands to check whether the v2store contains custom content #18993

Open
Tracked by #12913
ahrtr opened this issue Dec 3, 2024 · 5 comments
Assignees
Labels
priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release/v3.5 type/feature

Comments

@ahrtr
Copy link
Member

ahrtr commented Dec 3, 2024

What would you like to be added?

Part of #12913

etcd 3.6 will panic if the v2store contains custom content. Before users upgrade from 3.5 to 3.6, they must ensure there is no any custom content in v2store; and both the online and offline commands need to check it. For the offline command, it also needs to check the WAL records after the latest v2 snapshot file.

The proposed commands:

etcdctl check v2store
etcdutl check v2store

EDIT: We only need to add the offline tool. For online tool, Users should be able to use the existing etcdctl v2 command ETCDCTL_API=2 ./bin/etcdctl ls directly, refer to #19114 (comment)

Also --enable-v2 and --experimental-enable-v2v3 have already been removed i 3.6, so users must ensure that they do not configure these two flags before upgrading to 3.6. Only the online command checks it.

Why is this needed?

To ensure smooth upgrade from 3.5 to 3.6.

@ahrtr ahrtr added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Dec 3, 2024
@ahrtr
Copy link
Member Author

ahrtr commented Dec 3, 2024

For the command-line flags, let's take care of it in #18999. This issue focuses on checking the v2store.

@serathius
Copy link
Member

serathius commented Dec 4, 2024

Would it be better to integrate it into v3.6? Before starting etcd v3.6 we can scan for v2state and abort startup. Would prefer to minimize the number of steps needed to upgrade etcd. Upgrade should be safe by default.

@ahrtr
Copy link
Member Author

ahrtr commented Dec 4, 2024

Would it be better to integrate it into v3.6?

This tool is only targeted for 3.5. Users need to check the v2store before upgrading to 3.6 instead of after. But users don't have to run this tool if they have already removed or disabled the --enable-v2 for a long time.

In 3.6, etcd already has the function to check the v2store and will fail the start if v2store has custom content.

if err = serverstorage.AssertNoV2StoreContent(cfg.Logger, st, cfg.V2Deprecation); err != nil {
cfg.Logger.Error("illegal v2store content", zap.Error(err))
return nil, be, err

@ahrtr
Copy link
Member Author

ahrtr commented Dec 16, 2024

@fuweid any progress on this feature?

@fuweid
Copy link
Member

fuweid commented Dec 16, 2024

any progress on this feature?

@ahrtr I'm still working on it. Will file pull request once it's ready.

fuweid added a commit to fuweid/etcd that referenced this issue Dec 28, 2024
fuweid added a commit to fuweid/etcd that referenced this issue Dec 28, 2024
fuweid added a commit to fuweid/etcd that referenced this issue Dec 29, 2024
It's to use v2 API to list all keys in v2store. If there is any active
key in v2store, `etcdctl check v2store` returns error. However, the last
snapshot might still contain custom content. The end-user still needs to
check that content offline by `etcdutl check v2store`.

Part of etcd-io#18993

Signed-off-by: Wei Fu <[email protected]>
fuweid added a commit to fuweid/etcd that referenced this issue Dec 30, 2024
fuweid added a commit to fuweid/etcd that referenced this issue Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release/v3.5 type/feature
Development

No branches or pull requests

3 participants