feat(discovery): adjust boot order to find peers

The boot order for peers is -discovery, -peers, log data, forming
new cluster itself.

Special rules:
1. If discovery succeeds, it would find peers specified by discover URL
only.
2. Etcd would fail when meeting bad -discovery, no -peers and log data.

Add TestDiscoveryDownNoBackupPeersWithDataDir as the test.
This commit is contained in:
Yicheng Qin
2014-02-13 12:30:52 -08:00
parent bd56b15b6e
commit 3a4df1612c
8 changed files with 170 additions and 71 deletions

View File

@@ -94,7 +94,9 @@ func (r *Registry) clientURL(name string) (string, bool) {
return "", false
}
// Retrieves the host part of peer URL for a given node by name.
// TODO(yichengq): have all of the code use a full URL with scheme
// and remove this method
// PeerHost retrieves the host part of peer URL for a given node by name.
func (r *Registry) PeerHost(name string) (string, bool) {
rawurl, ok := r.PeerURL(name)
if ok {