etcdserver: add detailed errors in "ValidateClusterAndAssignIDs"

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
Gyuho Lee 2018-01-25 10:32:41 -08:00
parent e1de74913d
commit ce45c83f29

View File

@ -490,8 +490,8 @@ func ValidateClusterAndAssignIDs(local *RaftCluster, existing *RaftCluster) erro
ctx, cancel := context.WithTimeout(context.TODO(), 30*time.Second) ctx, cancel := context.WithTimeout(context.TODO(), 30*time.Second)
defer cancel() defer cancel()
for i := range ems { for i := range ems {
if !netutil.URLStringsEqual(ctx, ems[i].PeerURLs, lms[i].PeerURLs) { if ok, err := netutil.URLStringsEqual(ctx, ems[i].PeerURLs, lms[i].PeerURLs); !ok {
return fmt.Errorf("unmatched member while checking PeerURLs") return fmt.Errorf("unmatched member while checking PeerURLs (%v)", err)
} }
lms[i].ID = ems[i].ID lms[i].ID = ems[i].ID
} }