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

mgr: Allow more than two mgrs #12895

Merged
merged 1 commit into from
Sep 14, 2023
Merged

mgr: Allow more than two mgrs #12895

merged 1 commit into from
Sep 14, 2023

Conversation

travisn
Copy link
Member

@travisn travisn commented Sep 12, 2023

Description of your changes:
While two mgrs is considered sufficient, more mgr daemons are now allowed in case the admin wants even more fault tolerance to the active mgr going down, in case multiple mgrs go down. Up to five mgr pods will be allowed. All mgrs will be in standby mode except one active mgr. All mgr pods have a sidecar that will update their respective pod specs with the active or passive label.

Which issue is resolved by this Pull Request:
Resolves #12812

Checklist:

  • Commit Message Formatting: Commit titles and messages follow guidelines in the developer guide.
  • Reviewed the developer guide on Submitting a Pull Request
  • Pending release notes updated with breaking and/or notable changes for the next minor release.
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.

Copy link
Contributor

@subhamkrai subhamkrai left a comment

Choose a reason for hiding this comment

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

lgtm, also restarted the couple of ci

// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=2
// +kubebuilder:validation:Maximum=5
Copy link
Member

Choose a reason for hiding this comment

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

if we have a validation by CRD, why do we need secendory validation in the code?

Copy link
Member Author

Choose a reason for hiding this comment

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

The code validation must be there from before the crd schema validation. If you're referring to the maxMgrCount in code, that's still needed for deleting extra mgrs. But I'm going to look at the implementation again to see if we can have a better way to remove extras without duplicating that in code.

Copy link
Member Author

Choose a reason for hiding this comment

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

Now the maxMgrCount is removed from code and am querying for the existing mgrs to see if there are any extra to remove.

While two mgrs is considered sufficient, more mgr daemons are
now allowed in case the admin wants even more fault tolerance
to the active mgr going down, in case multiple mgrs go down.
Up to five mgr pods will be allowed. All mgrs will be in
standby mode except one active mgr. All mgr pods have a sidecar
that will update their respective pod specs with the active
or passive label.

Signed-off-by: travisn <tnielsen@redhat.com>
@travisn travisn merged commit 8da6dea into rook:master Sep 14, 2023
48 of 50 checks passed
@travisn travisn deleted the multiple-mgr branch September 14, 2023 21:02
mergify bot added a commit that referenced this pull request Sep 14, 2023
logger.Warningf("failed to check for extra mgrs. %v", err)
return
}
if len(mgrDeployments.Items) == len(daemonIDs) {
Copy link
Member

Choose a reason for hiding this comment

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

what if the deployments are less than daemons?

Copy link
Member Author

Choose a reason for hiding this comment

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

If there are fewer deployments, then the loop below will just not find any to remove. But I don't expect that to happen actually because this is called right after all the expected mgr daemons are reconciled.

continue
}
found := false
for _, daemonID := range daemonIDs {
Copy link
Member

Choose a reason for hiding this comment

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

if one of the mgr is deleted,

For ex: List of mgr{a,b,c}
b got deleted, new list {a,c}
Now a new mgr will try to get an added {a,c,d} to keep up the replica count but as per the daemonIDs array is implemented it will keep the daemonIDS list as {a,b,c} only
And later replica of mgr count become = 4
New list {a,c,d,e}

So now removing the mgr will work on
mgr list->{a,c,d,e} and hopefully daemon list should be {a,b,c,d}
By which this algo will remove e intentionally.

I can discuss more on this

Copy link
Member

Choose a reason for hiding this comment

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

PS: No it won't be a problem sorry for the confusion,
It would have applied to mon algorithm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow more than 2 mgr instances
3 participants