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

Create a v2 snapshot when running etcdutl migrate command #19168

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ahrtr
Copy link
Member

@ahrtr ahrtr commented Jan 10, 2025

Refer to #17911 (comment)

This PR will make the etcdutl migrate command fully functional.

  • It creates a v2snapshot from the v3store.
    You will never see error below anymore when executing etcdutl migrate command,

    Error: cannot downgrade storage, WAL contains newer entries, as the target version (3.5.0) is lower than the version (3.6.0) detected from WAL logs
    

    After executing the migrate command for all members, you just need to directly replace the binary of each member, then all done for the offline downgrade. Of course, it's still recommended to follow/perform the online downgrade process, as it doesn't break the workload. cc @ivanvc @jmhbnz

  • It also adds a separate etcdutl v2snapshot create command
    It's just a manual last to resort solution for any potential issue. Usually we don't need it.

I need to add e2e test. I may also break down it into smaller PRs.

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahrtr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ahrtr ahrtr force-pushed the etcdutl_snapshot_20250110 branch 2 times, most recently from 250f708 to d8f3b56 Compare January 10, 2025 18:21
Copy link

codecov bot commented Jan 10, 2025

Codecov Report

Attention: Patch coverage is 7.79221% with 71 lines in your changes missing coverage. Please review.

Project coverage is 68.73%. Comparing base (ad11af7) to head (df49a51).

Files with missing lines Patch % Lines
etcdutl/etcdutl/common.go 0.00% 47 Missing ⚠️
etcdutl/etcdutl/migrate_command.go 0.00% 24 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
server/etcdserver/api/membership/cluster.go 88.57% <100.00%> (+0.04%) ⬆️
etcdutl/etcdutl/migrate_command.go 0.00% <0.00%> (ø)
etcdutl/etcdutl/common.go 16.43% <0.00%> (-29.72%) ⬇️

... and 26 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #19168      +/-   ##
==========================================
- Coverage   68.83%   68.73%   -0.10%     
==========================================
  Files         420      420              
  Lines       35641    35703      +62     
==========================================
+ Hits        24535    24542       +7     
- Misses       9680     9745      +65     
+ Partials     1426     1416      -10     

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ad11af7...df49a51. Read the comment docs.

@ahrtr ahrtr force-pushed the etcdutl_snapshot_20250110 branch from d8f3b56 to 033f4cf Compare January 10, 2025 19:36
@ahrtr ahrtr force-pushed the etcdutl_snapshot_20250110 branch 2 times, most recently from d71fc9f to f59e8b8 Compare January 11, 2025 16:15
@ahrtr
Copy link
Member Author

ahrtr commented Jan 11, 2025

This is a huge PR, let me breakdown it into small PRs to make the review easier.

@ahrtr ahrtr force-pushed the etcdutl_snapshot_20250110 branch 4 times, most recently from 43a213e to acffdb5 Compare January 13, 2025 10:13
@etcd-io etcd-io deleted a comment from k8s-ci-robot Jan 13, 2025
@ahrtr ahrtr force-pushed the etcdutl_snapshot_20250110 branch from acffdb5 to 174c8b4 Compare January 13, 2025 12:25
Also added test to cover the etcdutl migrate command

Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
@serathius
Copy link
Member

So many codecov warnings, is there any way to hide them?

@ahrtr ahrtr force-pushed the etcdutl_snapshot_20250110 branch from 174c8b4 to df49a51 Compare January 13, 2025 13:01
@k8s-ci-robot
Copy link

k8s-ci-robot commented Jan 13, 2025

@ahrtr: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-etcd-robustness-arm64 df49a51 link true /test pull-etcd-robustness-arm64

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants