Explorar o código

etcdserver: add detailed errors in "ValidateClusterAndAssignIDs"

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Gyuho Lee %!s(int64=8) %!d(string=hai) anos
pai
achega
c5bba152ee
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      etcdserver/membership/cluster.go

+ 2 - 2
etcdserver/membership/cluster.go

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