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

cmd: add recover command tool #650

Merged
merged 4 commits into from
May 26, 2017
Merged

cmd: add recover command tool #650

merged 4 commits into from
May 26, 2017

Conversation

nolouch
Copy link
Contributor

@nolouch nolouch commented May 25, 2017

fmt.Println("cluster already bootstrapped")
return
}
fmt.Println("recover success! please restart PD")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to restart PD?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for reload cluster meta info.

// recover meta of cluster
clusterMeta := metapb.Cluster{
Id: *clusterID,
MaxPeerCount: uint32(3),
Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose we need to add it to command line argument.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

exitErr(err)
}
if !resp.Succeeded {
fmt.Println("cluster already bootstrapped")
Copy link
Contributor

Choose a reason for hiding this comment

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

Make it more like an error message. Such as "failed to recover: the cluster is already bootstrapped"

ops = append(ops, clientv3.OpPut(clusterRootPath, string(clusterValue)))

// set raft bootstrap time
nano := time.Now().UnixNano()
Copy link
Contributor

Choose a reason for hiding this comment

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

strange bootstrap time here...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

maybe we can recover it by dump tikv data later.


func main() {
flag.Parse()
if *clusterID == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

print and exit

Copy link
Contributor

@siddontang siddontang left a comment

Choose a reason for hiding this comment

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

Rest LGTM

@disksing
Copy link
Contributor

LGTM.

@disksing disksing merged commit 040ab87 into master May 26, 2017
@disksing disksing deleted the shuning/recover-tool branch May 26, 2017 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants