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

etcdctl/ctlv3: do not modify db file on "status" #11157

Merged
merged 1 commit into from
Sep 17, 2019

Conversation

gyuho
Copy link
Contributor

@gyuho gyuho commented Sep 17, 2019

This can break production rollback/downgrade process:

For example,

  1. start etcd v3.3.10
  2. write some data
  3. use etcdctl v3.3.10 to save snapshot
  4. somehow, upgrading Kubernetes fails, thus rolling back to previous version etcd v3.2.24
  5. run etcdctl v3.2.24 snapshot status against the snapshot file saved from v3.3.10 server
  6. run etcdctl v3.2.24 snapshot restore fails with "expected sha256 [12..."

/cc @wenjiaswe @jingyih

@jingyih
Copy link
Contributor

jingyih commented Sep 17, 2019

Trying to understand this issue. So it is step 5 that is causing this issue?

@gyuho
Copy link
Contributor Author

gyuho commented Sep 17, 2019

@jingyih Yes, etcdctl snapshot status without this change modifies the DB file. We disable freelist sync in v3.3, but when we open the DB file with write mode using etcdctl v3.2, we enable freelist sync again, thus writing the freelist to the DB file in snapshot status command.

Copy link
Contributor

@jingyih jingyih left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks. snapshot status should not modify the db file.

@gyuho gyuho merged commit b7fab55 into etcd-io:release-3.2 Sep 17, 2019
@gyuho gyuho deleted the release-3.2-patch branch September 17, 2019 18:11
@gyuho gyuho changed the title etcdctl/ctlv3: do not modify db file on "restore" etcdctl/ctlv3: do not modify db file on "status" Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants