Skip to content

Commit

Permalink
Add exception of a 1-node cluster to quorum protection
Browse files Browse the repository at this point in the history
  • Loading branch information
sttts committed Feb 22, 2016
1 parent 6957c4c commit 39a956f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions join/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ func (ma *memberAdder) protectCluster(ctx context.Context) error {
return fmt.Errorf("cluster is already full with %d members", ma.targetSize)
}

if startedMembers == 1 {
glog.Infof("One node cluster found. Joining is always unsafe, nothing to do about that. Continuing.")
return nil
}

futureQuorum := (startedMembers+1)/2 + 1
if healthyMembers < futureQuorum {
return fmt.Errorf("cannot add another member temporarily to the %d member "+
Expand Down

0 comments on commit 39a956f

Please sign in to comment.