-
Notifications
You must be signed in to change notification settings - Fork 727
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
Conversation
cmd/pd-recover/main.go
Outdated
fmt.Println("cluster already bootstrapped") | ||
return | ||
} | ||
fmt.Println("recover success! please restart PD") |
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.
Why do we need to restart PD?
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 reload cluster meta info.
cmd/pd-recover/main.go
Outdated
// recover meta of cluster | ||
clusterMeta := metapb.Cluster{ | ||
Id: *clusterID, | ||
MaxPeerCount: uint32(3), |
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.
I suppose we need to add it to command line argument.
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.
+1
cmd/pd-recover/main.go
Outdated
exitErr(err) | ||
} | ||
if !resp.Succeeded { | ||
fmt.Println("cluster already bootstrapped") |
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.
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() |
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.
strange bootstrap time here...
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.
maybe we can recover it by dump tikv data later.
|
||
func main() { | ||
flag.Parse() | ||
if *clusterID == 0 { |
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.
print and exit
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.
Rest LGTM
LGTM. |
cc @disksing @siddontang