-
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 snapshot step in etcdutl migrate
#17911
Comments
If you think this task is suitable for me i would like to give it a try. |
@ah8ad3 yes, it would be great if you can give it a try. You can ping me on slack if you have any questions. Thank you! |
Sorry do we have any implementation of getting snapshot without need of server? i couldn't find any, all i find needs |
|
Thanks for answer. I'll try to understand the code and see what can we do. @siyuanfoundation |
Also can you please explain what is
Clean from version tags? or delete? |
Think i got the answer from my last question. etcd/contrib/raftexample/raft.go Line 363 in d0ea231
|
I think you can do |
Thank you @siyuanfoundation it seems I tested out current behavior of
and force snapshot which removes all entries from wal file
Which doesn't change and wal:
It seems to me that In addition i suggest we remove extra tools and add all utility on db and wal files (etcd-dump-logs, etcd-dump-dbs) into |
Thank you @ah8ad3 for digging into this. When you run I think you make a really good point that there are too many tools. We can raise that in the community meeting. |
Sorry that took me a lot to respond this issue was a little bit hard for me i'm not that confident in etcd codebase, anyway. var f *os.File
defer f.Close()
partpath := "etcd-test-db"
f, err = os.OpenFile(partpath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, fileutil.PrivateFileMode)
if err != nil {
panic(fmt.Errorf("could not open %s (%v)", partpath, err))
}
c.lg.Info("created temporary db file", zap.String("path", partpath))
snapshot := c.be.Snapshot()
defer snapshot.Close()
snapshot.WriteTo(f) This will create a snapshot from the db and i test the restore with Also asked about this issue in main slack channel https://kubernetes.slack.com/archives/C3HD8ARJ5/p1716904436225239 , Marek said
And also
So i think this issue can be fixed with the code i suggested and we should fix the other issue #17227 . |
We can create a v2snapshot with consistent_index in v3store(bbolt), and all WAL records older than the consistent_index can be skipped. I agree it's doable, but I wouldn't suggest to spend huge effort on this. The |
I agree that this feature is nice to have, although it isn't a blocker for 3.6. I am thinking probably we can break down this feature into two smaller ones:
Both above two tasks may be able to share most of the source code/implementation. |
@ah8ad3 are you still working on this? Please feel free to reach out if you have any questions or comments. Thanks. |
Is anyone interested in working on this per #17911 (comment)? |
What would you like to be added?
Currently during downgrade, if there is a WAL entry with fields from the higher version, the offline migration tool
etcdutl migrate
would abort because of the version check. This would block the offline downgrade migration even if the entries of higher version have been committed to the backend.On the contrary, in the online migration, after enabling downgrade,
ClusterVersionSet
would downgrade the cluster version, and force snapshot, so that old WAL entries would be compacted and not blocking the migration.We need to make the offline migration consistent with the online migration flow, by adding a snapshot step before calling
schema.Migrate
Why is this needed?
To make offline downgrade consistent with online downgrade.
#13168 Milestone 3
The text was updated successfully, but these errors were encountered: