-
Notifications
You must be signed in to change notification settings - Fork 9.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
etcdctlv3: Add option to defrag a data directory directly #8367
Conversation
@jpbetz this seems fine to me. @heyitsanthony opinions? |
Looks OK in general, but probably needs something like https://github.com/coreos/etcd/blob/master/etcdctl/ctlv3/command/migrate_command.go#L105-L117 so it won't hang without any kind of message if running on a data dir in use by an active etcd process. |
Thanks @heyitsanthony, Added the "file locked" message--
|
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 thanks
@jpbetz Can you also update the documentation for etcdctl? Then it is good to go. |
@xiang90 I've added a section to op-guide/maintenance page. |
https://github.com/coreos/etcd/tree/master/etcdctl#defrag also needs to be updated. |
Thanks @xiang90. Updated the readme as well. |
etcdctl/README.md
Outdated
@@ -736,9 +736,10 @@ If NOSPACE alarm is present: | |||
|
|||
### DEFRAG |
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.
we need to mention the new option into the readme. example: https://github.com/coreos/etcd/tree/master/etcdctl#get-options-key-range_end
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.
Added the Options
section and updated command to DEFRAG [options]
.
@jpbetz it's queued |
…where etcd is not running.
lgtm |
@etcd-bot please retest this |
failures unrelated; merging |
@jpbetz I am going to merge this regardless the CI. Thanks for the contribution! |
@jpbetz @heyitsanthony is faster... |
Excellent. Thanks! |
We've run into a number of cases where it would be helpful to be able to defrag when etcd is not running. @heyitsanthony Is this an appropriate place to add such a command, or would it be better if I put it elsewhere? Maybe bbolt's CLI?