-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Add downgrade commands #13687
Add downgrade commands #13687
Conversation
fmt.Printf("Downgrade validate success, cluster version %s", r.Version) | ||
} | ||
func (s *simplePrinter) DowngradeEnable(r v3.DowngradeResponse) { | ||
fmt.Printf("Downgrade enable success, cluster version %s", r.Version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's clearer to change to "cluster version" to "target cluster version".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
34c2523
to
12d7d86
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
We can discuss/revisit the cancel()
vs defer cancel()
in separate session.
etcdctl/README.md
Outdated
|
||
```bash | ||
./etcdctl downgrade validate 3.5.0 | ||
Downgrade validate success, cluster version 3.6.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we expect automated scripts to parse that output, or there is more suitable format for automation, e.g.:
currentClusterVersion: 3.6.0
proposedClusterVersion: 3.5.0
validationStatus: SUCCESS
``` ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- shell we document that the request version needs to be 'major' (x.y.0) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For automation scripts I think we should add support for json output.
As for versions, I think we should change it to "{Major}.{Minor}" version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, for automated scripts -w json
will already work and write full response with cluster version.
etcdctl/README.md
Outdated
|
||
```bash | ||
./etcdctl downgrade cancel | ||
Downgrade cancel success, cluster version 3.6.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does success mean in the context of cancellation ?
That quorum is operating on 3.6.0 ? That all the nodes are at 3.6.0.
We should document the expectations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me properly document the commands.
fmt.Printf("Downgrade validate success, cluster version %s", r.Version) | ||
} | ||
func (s *simplePrinter) DowngradeEnable(r v3.DowngradeResponse) { | ||
fmt.Printf("Downgrade enable success, cluster version %s", r.Version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
Codecov Report
@@ Coverage Diff @@
## main #13687 +/- ##
==========================================
+ Coverage 72.57% 73.14% +0.56%
==========================================
Files 465 467 +2
Lines 37856 38847 +991
==========================================
+ Hits 27475 28413 +938
- Misses 8596 8603 +7
- Partials 1785 1831 +46
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@serathius Are you going add an item for this PR into 3.6 CHANGELOG? |
Yes, I should add a note in umbrella issue for downgrades |
Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.
Followup on #13360 @LeoYang90
With downgrades implemented we can introduce etcdctl downgrade command. There are still some problems with API (request always times out however I think this is enough for alpha.
Would be great if someone took a look why downgrade api returns timeout.
cc @ptabor @spzala @ahrtr