B3+B4+B13: cluster index, placeholders, MC admission validators#1034
Draft
anandsyncs wants to merge 14 commits intomc-search-b14-distributionfrom
Draft
B3+B4+B13: cluster index, placeholders, MC admission validators#1034anandsyncs wants to merge 14 commits intomc-search-b14-distributionfrom
anandsyncs wants to merge 14 commits intomc-search-b14-distributionfrom
Conversation
Contributor
Author
|
Evergreen validation: https://evergreen.mongodb.com/patch/69f1e94c2089ca000759e23d |
Contributor
Author
|
B13 admission residuals folded in (4 new validators). Re-triggered Evergreen: https://evergreen.mongodb.com/patch/69f1ed87e9e6d9000787d7eb (supersedes the earlier B3+B4-only patch) |
…e-entry validation
…reClusterIndexAnnotation
Multi-cluster MongoDBSearch at GA = Q1 or Q2 (managed LB only). Q3-MC and Q4-MC are deferred post-GA per spec §4.4 / §B0.2. Single-cluster unmanaged LB stays unchanged.
len(spec.clusters) > 1 with spec.loadBalancer == nil is Q5-MC / Q6-MC and permanently rejected per spec §4.4 / §B0.2 — MC requires Envoy. Combined with the unmanaged-LB rejection from the prior commit, MC at GA is enforced symbolically as "managed LB only" without per-cluster replica introspection.
Per spec §4.4, clusters[].clusterName must be non-empty when MC. Single- cluster degenerate case (len <= 1) keeps allowing an empty clusterName. Ordered before validateClustersUniqueClusterName so the dedicated "is required" message fires instead of "duplicate" for the two-empty- names case.
An explicitly-set-but-empty matchTags in spec.clusters[].syncSourceSelector is meaningless when MC: the operator cannot peek at the external replSetConfig to autodetect tags. nil (omitted) is fine — inherits. Pairs with B14's validateClustersSyncSourceSelector (matchTags-vs-hosts mutual exclusion).
42a173a to
013644b
Compare
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.
Summary
Consolidates B3 (per-cluster index annotation), B4 (
{clusterName}/{clusterIndex}placeholder resolution), and B13 (residual MC admission validators) into one PR — they're all CRD-level admission/validation work for the multi-cluster MongoDBSearch MVP, and reviewing them together catches inter-rule overlap.Changes
B3 — cluster index annotation
AssignClusterIndices(existing, currentClusterNames) map[string]int— preserves existing assignments, monotonic-only, never reuses on remove/re-addClusterIndex(search, clusterName)accessor for downstream consumersmongodb.com/v1.last-cluster-num-mappingpersisted on the MongoDBSearch CR at reconcile entryclusterNamerename in a single Update (rename = recreate)B4 — placeholder resolution
{clusterName}and{clusterIndex}resolvers inloadBalancer.managed.externalHostname{clusterName}or{clusterIndex}whenlen(spec.clusters) > 1{shardName}B13 — MC admission residuals (4 new validators)
validateMCRejectsUnmanagedLB— Q3/Q4-MC reject (len(clusters) > 1+ unmanaged LB)validateMCRequiresLoadBalancerManaged— Q5/Q6-MC reject (len(clusters) > 1+ no LB)validateClustersClusterNameNonEmpty— explicit empty-string rejection with clear errorvalidateMCMatchTagsNonEmpty— empty MatchTags map rejected (operator can't autodetect from externalreplSetConfig)(MongoDBCommunity-source MC rejection is already covered by B2's
validateMCRequiresExternalSource.)Stack
spec.clusters[]types + defaulting)Replaces
Out of scope
Testing
go test ./api/v1/search/... ./controllers/searchcontroller/... ./controllers/operator/...passesgolangci-lint run ./api/v1/search/...clean