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

etcdutl: Implement migrate --force command #13220

Merged
merged 1 commit into from
Aug 4, 2021

Conversation

serathius
Copy link
Member

#13168
Part of #13168

This PR adds an etcdutl migrate --force command that is able to migrate schema of data located in etcd data dir. Implementing only force as we need an escape hatch for uses that depend on running etcd from older versions.

Implementation of migrate will be added in next milestones when we will have full schema in place.
cc @lilic @ptabor

@serathius serathius force-pushed the migrateforce branch 2 times, most recently from e9c9433 to e7df6c0 Compare July 16, 2021 13:09
@serathius serathius mentioned this pull request Jul 16, 2021
13 tasks
etcdutl/etcdutl/migrate_command.go Outdated Show resolved Hide resolved
etcdutl/etcdutl/migrate_command.go Outdated Show resolved Hide resolved
etcdutl/etcdutl/migrate_command.go Outdated Show resolved Hide resolved
tests/e2e/utl_migrate_test.go Outdated Show resolved Hide resolved
@serathius serathius force-pushed the migrateforce branch 5 times, most recently from 0f26fe5 to fdbeac5 Compare July 19, 2021 15:00
@serathius
Copy link
Member Author

Fixed all issues, PTAL.

@yuzhiquan
Copy link
Contributor

/lgtm

@serathius serathius force-pushed the migrateforce branch 2 times, most recently from 4ea35fa to 0ddc5b3 Compare July 30, 2021 12:13
force: o.force,
}
var err error
dotCount := strings.Count(o.targetVersion, ".")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would the line 82 succeed if the version didn't contain "." ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, semver parsing always requires "Major.Minor.Patch". Here we just hardcode patch to 0.
I think we should have a special struct just to represent "Major.Minor" instead of reusing semver

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see: It's just about adding more human friendly error...

etcdutl/etcdutl/migrate_command.go Outdated Show resolved Hide resolved
etcdutl/etcdutl/migrate_command.go Outdated Show resolved Hide resolved
@serathius serathius force-pushed the migrateforce branch 3 times, most recently from 8becbbf to 2f8532d Compare August 4, 2021 11:25
Co-authored-by: nic-chen <33000667+nic-chen@users.noreply.github.com>
Co-authored-by: Heisenberg <yuzhiquanlong@gmail.com>
@ptabor ptabor merged commit e591fcb into etcd-io:main Aug 4, 2021
@serathius serathius deleted the migrateforce branch June 15, 2023 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants