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 67.79661% with 19 lines in your changes missing coverage. Please review.

Project coverage is 68.76%. Comparing base (ab819b5) to head (e3fb899).

Files with missing lines Patch % Lines
etcdutl/etcdutl/common.go 76.92% 6 Missing and 6 partials ⚠️
etcdutl/etcdutl/migrate_command.go 0.00% 7 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
etcdutl/etcdutl/migrate_command.go 0.00% <0.00%> (ø)
etcdutl/etcdutl/common.go 74.35% <76.92%> (+28.20%) ⬆️

... and 24 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #19168      +/-   ##
==========================================
- Coverage   68.84%   68.76%   -0.08%     
==========================================
  Files         420      420              
  Lines       35635    35693      +58     
==========================================
+ Hits        24533    24545      +12     
- Misses       9686     9723      +37     
- Partials     1416     1425       +9     

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 ab819b5...e3fb899. 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
@serathius
Copy link
Member

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

@ahrtr ahrtr force-pushed the etcdutl_snapshot_20250110 branch 2 times, most recently from df49a51 to 099e356 Compare January 15, 2025 16:15
@ahrtr ahrtr force-pushed the etcdutl_snapshot_20250110 branch from 099e356 to 1187204 Compare January 15, 2025 19:06
@ahrtr ahrtr force-pushed the etcdutl_snapshot_20250110 branch from 1187204 to 1180f3a Compare January 15, 2025 19:33
@ahrtr
Copy link
Member Author

ahrtr commented Jan 15, 2025

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

Added an unit test, PTAL.

cc @fuweid @serathius @siyuanfoundation

@ahrtr ahrtr force-pushed the etcdutl_snapshot_20250110 branch from 1180f3a to 84c55d3 Compare January 15, 2025 21:36
@ahrtr ahrtr force-pushed the etcdutl_snapshot_20250110 branch from 84c55d3 to 5695acd Compare January 16, 2025 15:22
Also added test to cover the etcdutl migrate command

Signed-off-by: Benjamin Wang <[email protected]>
@ahrtr ahrtr force-pushed the etcdutl_snapshot_20250110 branch from 5695acd to e3fb899 Compare January 16, 2025 15:33
@ahrtr
Copy link
Member Author

ahrtr commented Jan 16, 2025

/retest

@ahrtr
Copy link
Member Author

ahrtr commented Jan 16, 2025

/test pull-etcd-robustness-arm64

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