-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
etcdctl: add migrate command #5391
Conversation
e7b5846
to
263344c
Compare
migrateTransformer string | ||
) | ||
|
||
// NewMigrate returns the cobra command for "Migrate". |
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.
// NewMigrateCommand ...
?
Can we have some migration guide README after this? |
binary.BigEndian.PutUint64(bytes[9:], uint64(rev.sub)) | ||
} | ||
|
||
func writeIndex(be backend.Backend, index uint64) { |
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.
this and writeToBackend seem like they belong in the mvcc package
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.
@heyitsanthony I will make that a public func in mvcc pkg.
2e796c9
to
34c2bba
Compare
dw.Close() | ||
}() | ||
|
||
for { |
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 decoder.More() {
lgtm |
Migrate command accepts a datadir and an optional user-provided transformer function that transform v2 keys to v2 keys. Migrate command then builds a v3 backend state based on the existing v2 keys and the output of the transformer function.
…rease Reason to store CI and term in backend was to make db fully independent snapshot, it was never meant to interfere with apply logic. Skip of CI was introduced for v2->v3 migration where we wanted to prevent it from decreasing when replaying wal in etcd-io#5391. By mistake it was added to apply flow during refactor in etcd-io#12855 (comment). Consistency index and term should only be negotiated and used by raft to make decisions. Their values should only driven by raft state machine and backend should only be responsible for storing them.
…rease Reason to store CI and term in backend was to make db fully independent snapshot, it was never meant to interfere with apply logic. Skip of CI was introduced for v2->v3 migration where we wanted to prevent it from decreasing when replaying wal in etcd-io#5391. By mistake it was added to apply flow during refactor in etcd-io#12855 (comment). Consistency index and term should only be negotiated and used by raft to make decisions. Their values should only driven by raft state machine and backend should only be responsible for storing them.
…rease Reason to store CI and term in backend was to make db fully independent snapshot, it was never meant to interfere with apply logic. Skip of CI was introduced for v2->v3 migration where we wanted to prevent it from decreasing when replaying wal in etcd-io#5391. By mistake it was added to apply flow during refactor in etcd-io#12855 (comment). Consistency index and term should only be negotiated and used by raft to make decisions. Their values should only driven by raft state machine and backend should only be responsible for storing them.
…rease Reason to store CI and term in backend was to make db fully independent snapshot, it was never meant to interfere with apply logic. Skip of CI was introduced for v2->v3 migration where we wanted to prevent it from decreasing when replaying wal in etcd-io#5391. By mistake it was added to apply flow during refactor in etcd-io#12855 (comment). Consistency index and term should only be negotiated and used by raft to make decisions. Their values should only driven by raft state machine and backend should only be responsible for storing them.
…rease Reason to store CI and term in backend was to make db fully independent snapshot, it was never meant to interfere with apply logic. Skip of CI was introduced for v2->v3 migration where we wanted to prevent it from decreasing when replaying wal in etcd-io#5391. By mistake it was added to apply flow during refactor in etcd-io#12855 (comment). Consistency index and term should only be negotiated and used by raft to make decisions. Their values should only driven by raft state machine and backend should only be responsible for storing them.
/cc @heyitsanthony @hongchaodeng
Migrate command accepts a datadir and an optional user-provided
transformer function that transform v2 keys to v2 keys.
Migrate command then builds a v3 backend state based on the existing
v2 keys and the output of the transformer function.