Skip to content

Commit 39a956f

Browse files
committed
Add exception of a 1-node cluster to quorum protection
1 parent 6957c4c commit 39a956f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

join/add.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@ func (ma *memberAdder) protectCluster(ctx context.Context) error {
157157
return fmt.Errorf("cluster is already full with %d members", ma.targetSize)
158158
}
159159

160+
if startedMembers == 1 {
161+
glog.Infof("One node cluster found. Joining is always unsafe, nothing to do about that. Continuing.")
162+
return nil
163+
}
164+
160165
futureQuorum := (startedMembers+1)/2 + 1
161166
if healthyMembers < futureQuorum {
162167
return fmt.Errorf("cannot add another member temporarily to the %d member "+

0 commit comments

Comments
 (0)