Skip to content

Commit c3cc949

Browse files
committed
Be more verbose about the actual algorithm
1 parent 0effb82 commit c3cc949

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

join/join.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,13 @@ func Join(
239239
if err != nil {
240240
return nil, err
241241
}
242+
242243
if activeNodes != nil && len(activeNodes) == 0 {
243244
// cluster down. Restarting nodes with the same config.
244-
245245
if fresh {
246246
return nil, errors.New("Cluster is down. A new node cannot join now.")
247+
} else {
248+
glog.Infof("Existing cluster seems to be done. No healthy node found. Trying to resume cluster.")
247249
}
248250

249251
return &EtcdConfig{
@@ -266,6 +268,8 @@ func Join(
266268

267269
initialNamedURLs := []string{advertisedNamedURLs[0]}
268270
if strategy != PreparedStrategy && fresh {
271+
glog.Infof("Existing cluster found. Trying to join with %q strategy.")
272+
269273
adder, err := newMemberAdder(
270274
activeNodes,
271275
strategy,
@@ -285,6 +289,8 @@ func Join(
285289
for _, u := range initialURLs {
286290
initialNamedURLs = append(initialNamedURLs, fmt.Sprintf("%s=%s", name, u))
287291
}
292+
} else {
293+
glog.Infof("Existing cluster found. Trying to join without adding this instance as a member.")
288294
}
289295

290296
return &EtcdConfig{
@@ -294,6 +300,8 @@ func Join(
294300
Name: name,
295301
}, nil
296302
} else {
303+
glog.Infof("Trying to launch new cluster.")
304+
297305
return &EtcdConfig{
298306
InitialClusterState: "new",
299307
Discovery: discoveryURL,

0 commit comments

Comments
 (0)