Skip to content
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

Merged
merged 1 commit into from Dec 3, 2021

Conversation

travisn
Copy link
Member

@travisn travisn commented Dec 1, 2021

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:

  • Commit Message Formatting: Commit titles and messages follow guidelines in the developer guide.
  • Skip Tests for Docs: Add the flag for skipping the build if this is only a documentation change. See here for the flag.
  • Skip Unrelated Tests: Add a flag to run tests for a specific storage provider. See test options.
  • Reviewed the developer guide on Submitting a Pull Request
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.
  • Pending release notes updated with breaking and/or notable changes, if necessary.
  • Upgrade from previous release is tested and upgrade user guide is updated, if necessary.
  • Code generation (make codegen) has been run to update object specifications, if necessary.

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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
logger.Infof("stretch mode is already enabled")
logger.Info("stretch mode is already enabled")

pkg/daemon/ceph/client/mon.go Show resolved Hide resolved
Comment on lines 500 to 508
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}
Copy link
Member

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?

Copy link
Member Author

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>
@travisn travisn merged commit 117229a into rook:master Dec 3, 2021
@travisn travisn deleted the failover-arbiter branch December 3, 2021 18:28
mergify bot added a commit that referenced this pull request Dec 3, 2021
mon: Set stretch tiebreaker reliably during failover (backport #9282)
mergify bot added a commit that referenced this pull request Dec 3, 2021
mon: Set stretch tiebreaker reliably during failover (backport #9282)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants