forked from rook/rook
At startup there is a race condition between the goroutine checking for mon health and the first reconcile of the mons. There is a lock that ensures only one of them will check the mon health at a time. The issue is that if the wrong one gets there first, it will not have the desired mon count initialized from the cluster CR as expected and the healther checker will use a desired mon count of 0. The desired count of 0 leads the health checker to remove a mon since there are extra mons. Only one mon is allowed to be removed at a time, and adjusting to fewer than two mons is disallowed once there are at least two mons. After the health checker is completed, the main reconcile of the mons will proceed with the correct desired mon count of 3 and attempt to restore to the real desired quorum size. Signed-off-by: Travis Nielsen <tnielsen@redhat.com>