fix: auto member join for mongodb#12
Merged
zijiren233 merged 2 commits intoFeb 5, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request fixes a critical issue where MongoDB secondary pods fail to join the cluster after direct replica updates, leaving them in a Running state without role labels while the component remains in Updating status.
Changes:
- Introduced auto-detection of pods that should join the cluster when the annotation is empty
- Added special handling for MongoDB to enable member join operations without explicit MemberJoin lifecycle action configuration
- Relaxed pod detection criteria to include Running pods (not just Ready pods)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
zijiren233
approved these changes
Feb 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue:
After directly updating Cluster replicas, MongoDB keeps only the primary; secondaries never join. Pods are Running but have no role label and the component stays Updating.
Root Cause:
memberJoin is triggered only via annotation; when scale-out is bypassed and ClusterDefinition doesn’t define memberJoin, join never runs. The detection was also too strict (Ready-only), creating a deadlock.
Fix:
Impact:
Limited to MongoDB components (CharacterType=mongodb with roleProbe builtinHandler=mongodb). Other engines are unaffected.
Code:
controllers/apps/transformer_component_workload.go
Verification:
Trigger reconcile, confirm controller logs show “detected pods to member join”, and validate pod role labels + rs.status members are complete.
Tests:
Not run (manual verification via reconcile + role labels + rs.status).
If you want, I can also provide a shorter “summary + test plan” version.