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

etcdctlv3: Add option to defrag a data directory directly #8367

Merged
merged 1 commit into from
Aug 8, 2017

Conversation

jpbetz
Copy link
Contributor

@jpbetz jpbetz commented Aug 4, 2017

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?

@xiang90
Copy link
Contributor

xiang90 commented Aug 4, 2017

@jpbetz this seems fine to me.

@heyitsanthony opinions?

@heyitsanthony
Copy link
Contributor

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.

@jpbetz
Copy link
Contributor Author

jpbetz commented Aug 7, 2017

Thanks @heyitsanthony,

Added the "file locked" message--

waiting for etcd to close and release its lock on "default.etcd/member/snap/db". To defrag a running etcd instance, omit --data-dir.

Copy link
Contributor

@heyitsanthony heyitsanthony 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

@xiang90
Copy link
Contributor

xiang90 commented Aug 7, 2017

@jpbetz Can you also update the documentation for etcdctl? Then it is good to go.

@jpbetz
Copy link
Contributor Author

jpbetz commented Aug 7, 2017

@xiang90 I've added a section to op-guide/maintenance page.

@xiang90
Copy link
Contributor

xiang90 commented Aug 7, 2017

@jpbetz
Copy link
Contributor Author

jpbetz commented Aug 7, 2017

Thanks @xiang90. Updated the readme as well.

@@ -736,9 +736,10 @@ If NOSPACE alarm is present:

### DEFRAG
Copy link
Contributor

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

Copy link
Contributor Author

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].

@heyitsanthony
Copy link
Contributor

@jpbetz it's queued

@xiang90
Copy link
Contributor

xiang90 commented Aug 8, 2017

lgtm

@gyuho gyuho changed the title Add option to defrag a data directory directly etcdctlv3: Add option to defrag a data directory directly Aug 8, 2017
@jpbetz
Copy link
Contributor Author

jpbetz commented Aug 8, 2017

@etcd-bot please retest this

@heyitsanthony
Copy link
Contributor

failures unrelated; merging

@heyitsanthony heyitsanthony merged commit 754f454 into etcd-io:master Aug 8, 2017
@xiang90
Copy link
Contributor

xiang90 commented Aug 8, 2017

@jpbetz I am going to merge this regardless the CI. Thanks for the contribution!

@xiang90
Copy link
Contributor

xiang90 commented Aug 8, 2017

@jpbetz @heyitsanthony is faster...

@jpbetz
Copy link
Contributor Author

jpbetz commented Aug 8, 2017

Excellent. Thanks!

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