-
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
Export 'snapshot restore' logic #8632
Comments
Snapshotting is server <-> client communication process, so it is in client library. Restore is a local logic, thus it is inside etcdctl not client library. Exposing the restore logic is a nice thing to have. I assume some users (probably this is also your motivation?) prefer directly invoking funcs from Go instead of depending on the etcdctl binary. I do not this is urgent to put into the most recent 3.3 release. But we probably can do this in 3.4 or later. /cc @jpbetz |
+1, I would really like to have this as an etcd Go client consumer in a Kubernetes project |
Hi, I'd like to work on this issue if it's not taken already. This would be my first contribution so I'd appreciate some help regarding where to get started. 😄 |
Sure! Glad you want to help.
…On Dec 6, 2017 9:58 AM, "Shubheksha Jalan" ***@***.***> wrote:
Hi, I'd like to work on this issue if it's not taken already. This would
be my first contribution so I'd appreciate some help regarding where to get
started. 😄
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8632 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AERby5NO7iDpYIv3MYZWfVmKeDINt0DQks5s9rmxgaJpZM4Pp0Or>
.
|
Here is another good reason to implement this while my code uses etcd 3.2.13, both CoreOS Stable 1576 and Alpine Linux ships with etcd binary 3.2.9/3.2.8. Because I must use the binary to restore a snapshot, here is what happens when I try:
However, no problem whatsoever with the 3.2.13 binary. (of course, I can also install that version manually, to solve the issue - but it could still mess someone up) |
This prevents panics when restoring a snapshot, with an outdated version of etcdctl. This is until the function can be exported for library usage [1]. [1]: etcd-io/etcd#8632
This prevents panics when restoring a snapshot, with an outdated version of etcdctl. This is until the function can be exported for library usage [1]. [1]: etcd-io/etcd#8632
The logic to restore a snapshot is currently located in the command package, unexported. That's over 200 lines of logic right there.
While most of the features that etcd offers can be used directly from Go - including making snapshots and starting embed servers - restoring snapshot cannot. This means that for that very feature only, one must shell out to the etcdctl binary, which means one must have that binary on disk in the first place. It also means the snapshot to restore must be sync'd to disk first, rather than being able to use a io.Reader.
I don't know how valuable that command is for non-human operators but we could imagine apps restoring snapshots to easily put fixtures (e.g. tests) in place for example, or initialize data.
Would it be a task worth the effort for you guys? Thanks in advance.
cc @xiang90
The text was updated successfully, but these errors were encountered: