Browse Source

Merge pull request #1452 from unihorn/187

etcdserver: exit program when node is removed
Yicheng Qin 11 years ago
parent
commit
ac71ad92af
1 changed files with 2 additions and 2 deletions
  1. 2 2
      etcdserver/sender.go

+ 2 - 2
etcdserver/sender.go

@@ -108,11 +108,11 @@ func httpPost(c *http.Client, url string, cid uint64, data []byte) bool {
 	switch resp.StatusCode {
 	case http.StatusPreconditionFailed:
 		// TODO: shutdown the etcdserver gracefully?
-		log.Panicf("clusterID mismatch")
+		log.Fatalf("etcd: conflicting cluster ID with the target cluster (%s != %s). Exiting.", resp.Header.Get("X-Etcd-Cluster-ID"), strutil.IDAsHex(cid))
 		return false
 	case http.StatusForbidden:
 		// TODO: stop the server
-		log.Panicf("the member has been removed")
+		log.Fatalf("etcd: this member has been permanently removed from the cluster. Exiting.")
 		return false
 	case http.StatusNoContent:
 		return true