New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mon: Set stretch tiebreaker reliably during failover #9282
Conversation
pkg/operator/ceph/cluster/mon/mon.go
Outdated
logger.Infof("stretch mode is already enabled") | ||
// only support arbiter failover if at least v16.2.7 | ||
if !c.ClusterInfo.CephVersion.IsAtLeast(arbiterFailoverSupportedCephVersion) { | ||
logger.Infof("stretch mode is already enabled") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logger.Infof("stretch mode is already enabled") | |
logger.Info("stretch mode is already enabled") |
c.ClusterInfo.CephVersion = cephver.CephVersion{Major: 16, Minor: 2, Extra: 6} | ||
err := c.ConfigureArbiter() | ||
assert.NoError(t, err) | ||
assert.False(t, setNewTiebreaker) | ||
}) | ||
t.Run("stretch mode already configured - new", func(t *testing.T) { | ||
c.ClusterInfo.CephVersion = cephver.CephVersion{Major: 16, Minor: 2, Extra: 7} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a specific reason the Ceph version is 16.2.6
? Is there a specific reason it changes from 16.2.6
to 16.2.7
between these tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking for the current tiebreaker mon requires 16.2.7. "ceph mon dump" results will be different on the older versions. The test isn't very clear about this, i'll update it.
The failover of the arbiter mon in a stretch cluster was sometimes failing due to the new tiebreaker not being set in ceph. Rook would repeatedly try to remove the old tiebreaker mon and keep failing because the new tiebreaker had not been set. Now we make setting the tiebreaker idempotent in case the operator restarts in the middle of the operation or some other corner case causes the expected tiebreaker to be set. In that case, the next reconcile will also ensure the tiebreaker mon is set as expected. Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
6cd8ad1
to
d556692
Compare
mon: Set stretch tiebreaker reliably during failover (backport #9282)
mon: Set stretch tiebreaker reliably during failover (backport #9282)
Description of your changes:
The failover of the arbiter mon in a stretch cluster was sometimes failing due to the new tiebreaker not being set in ceph. Rook would repeatedly try to remove the old tiebreaker mon and keep failing because the new tiebreaker had not been set. Now we make setting the tiebreaker idempotent in case the operator restarts in the middle of the operation or some other corner case causes the expected tiebreaker to be set. In that case, the next reconcile will also ensure the tiebreaker mon is set as expected.
Checklist:
make codegen
) has been run to update object specifications, if necessary.