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

etcdctl: add migrate command #5391

Merged
merged 1 commit into from
May 19, 2016
Merged

etcdctl: add migrate command #5391

merged 1 commit into from
May 19, 2016

Conversation

xiang90
Copy link
Contributor

@xiang90 xiang90 commented May 18, 2016

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

@xiang90 xiang90 force-pushed the migrate branch 2 times, most recently from e7b5846 to 263344c Compare May 18, 2016 17:23
migrateTransformer string
)

// NewMigrate returns the cobra command for "Migrate".
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// NewMigrateCommand ...?

@gyuho
Copy link
Contributor

gyuho commented May 18, 2016

Can we have some migration guide README after this?

binary.BigEndian.PutUint64(bytes[9:], uint64(rev.sub))
}

func writeIndex(be backend.Backend, index uint64) {
Copy link
Contributor

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

Copy link
Contributor Author

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.

@xiang90 xiang90 force-pushed the migrate branch 7 times, most recently from 2e796c9 to 34c2bba Compare May 19, 2016 17:59
dw.Close()
}()

for {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for decoder.More() {

@heyitsanthony
Copy link
Contributor

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.
@xiang90 xiang90 merged commit edb1188 into etcd-io:master May 19, 2016
@xiang90 xiang90 deleted the migrate branch May 19, 2016 19:33
serathius added a commit to serathius/etcd that referenced this pull request Apr 7, 2022
…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.
serathius added a commit to serathius/etcd that referenced this pull request Apr 7, 2022
…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.
serathius added a commit to serathius/etcd that referenced this pull request Apr 7, 2022
…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.
serathius added a commit to serathius/etcd that referenced this pull request Apr 7, 2022
…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.
tjungblu pushed a commit to tjungblu/etcd that referenced this pull request Sep 7, 2022
…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.
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.

3 participants