-
Notifications
You must be signed in to change notification settings - Fork 161
K8SPSMDB-1466 improve MCS error handling to prevent operator crashes #2044
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
base: main
Are you sure you want to change the base?
Conversation
| // MCS is optional functionality - if discovery fails for any reason, | ||
| // mark it as unavailable and continue without crashing the operator | ||
| available = false | ||
| return nil |
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.
i think we need to log the error and inform users that MCS is not available
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.
commit: cbb0b70 |
CHANGE DESCRIPTION
Description
This PR fixes the issue where the Percona Server MongoDB Operator would crash when encountering errors during Multi-Cluster Services (MCS) discovery, specifically the "stale GroupVersion discovery" error.
Problem
The operator was crashing with the following error:
This occurred in the MCS registration process when
dc.ServerPreferredResources()failed, causing the entire operator pod to crash and restart.Solution
Register()function inpkg/mcs/register.goto handle any discovery error gracefullyNew Unit Tests in
pkg/mcs/register_test.goTestIsAvailable(): Tests MCS availability statusTestMCSSchemeGroupVersion(): Tests scheme group version initializationTestServiceExport(): Tests ServiceExport object creationTestServiceExportList(): Tests ServiceExportList object creationBenefits
Testing
Type of Change
Checklist
Related Issues
Fixes the operator crash issue when MCS discovery fails with "stale GroupVersion discovery" error.
Additional Notes
This fix ensures that MCS (Multi-Cluster Services) is treated as an optional feature. When MCS discovery fails for any reason, the operator gracefully marks MCS as unavailable and continues with normal MongoDB cluster operations. This makes the operator more resilient and prevents unnecessary pod restarts.