Skip to content

KUBE-178: Remove the MDB_SEARCH_ENABLE_MULTI_CLUSTER feature gate#1392

Draft
anandsyncs wants to merge 1 commit into
masterfrom
anand/kube-178-remove-search-mc-feature-gate
Draft

KUBE-178: Remove the MDB_SEARCH_ENABLE_MULTI_CLUSTER feature gate#1392
anandsyncs wants to merge 1 commit into
masterfrom
anand/kube-178-remove-search-mc-feature-gate

Conversation

@anandsyncs

Copy link
Copy Markdown
Contributor

Summary

Multi-cluster MongoDBSearch went GA in MCK 1.9.0, so the pre-GA MDB_SEARCH_ENABLE_MULTI_CLUSTER feature gate is dead weight. The gate (default off, intentionally undocumented) made a central/single operator reject any MongoDBSearch with more than one spec.clusters entry with workflow.Invalid. This PR removes the gate entirely: the operator now reconciles multi-cluster MongoDBSearch resources unconditionally, relying on the existing spec validators (ValidateSpec / per-cluster index validation). Removing it is safe because the flag was never documented for customers and GA shipped the multi-cluster behavior as supported.

Removed surface:

Surface What was removed
pkg/util/constants.go SearchEnableMultiClusterEnv const
controllers/operator/mongodbsearch_controller.go the central-operator multi-cluster block in the pre-reconcile validation
helm_chart/templates/operator.yaml conditional MDB_SEARCH_ENABLE_MULTI_CLUSTER env block (search.enableMultiCluster value)
scripts/funcs/operator_deployment, scripts/dev/contexts/* env var → helm value plumbing and dev-context exports
Block-regression e2e tests/search/search_block_multi_cluster.py, task e2e_search_block_multi_cluster, task group e2e_mdb_kind_search_block_task_group, variant e2e_mdb_kind_ubi_cloudqa_search_block and its context file (they existed solely to verify the gate)

Proof of Work

  • go build ./... and go test ./controllers/operator/... ./controllers/searchcontroller/... ./pkg/util/... pass; gate-toggling unit tests removed, and the existing multi-cluster reconcile tests (e.g. TestMongoDBSearchReconcile_Success_MultiCluster, the TestReconcile_OperatorPerCluster_* suite) now pass without any env var.
  • helm template helm_chart --set search.enableMultiCluster=true no longer emits MDB_SEARCH_ENABLE_MULTI_CLUSTER; plain helm template succeeds.
  • evergreen validate .evergreen.yml passes (pre-existing unrelated warnings only).
  • make precommit: all change-relevant hooks green with no generated-file drift.
  • e2e: the existing multi-cluster search e2e variants exercise the now-unconditional reconcile path in CI; the deleted block e2e was the only test of the removed gate.

Checklist

  • Have you linked a jira ticket and/or is the ticket in the title?
  • Have you checked whether your jira ticket required DOCSP changes?
  • Have you added changelog file?

Multi-cluster MongoDBSearch went GA in MCK 1.9.0, so the pre-GA feature
gate that made a central/single operator reject multi-cluster specs is
dead weight. Remove the env var, the helm value plumbing, the dev-context
exports, and the block-regression e2e (task, task group, variant and
context). Multi-cluster reconcile is now unconditional.
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ (this preview might not be accurate if the PR is not rebased on current master branch)

MCK 1.10.0 Release Notes

New Features

  • MongoDBOpsManager, AppDB: The mongodb-agent-monitoring sidecar container has been merged into the main
    mongodb-agent container. Both automation and monitoring now run as a single process in a single container. The
    spec.appDB.monitoringAgent field is now deprecated and has no effect; Monitoring Agent options for the AppDB —
    including log level and rotation — are configured via spec.applicationDatabase.agent and
    spec.applicationDatabase.agent.monitoringAgent, the same fields used by MongoDB resources. Enabling AppDB
    monitoring still results in rolling restarts of AppDB pods.
  • MongoDBSearch: Added support to show cluster level status of Search, Managed LoadBalancer and MetricsForwarder in the MongoDBSearch resource's status.clusters field.
  • MongoDBSearch: Added support to configure the node affinity of the MongoDB Search (mongot) pods using the MongoDBSearch CR fields spec.clusters[].nodeAffinity or spec.clusters[].shardOverrides[].nodeAffinity.

Bug Fixes

  • MongoDBUser: Fixed a bug where the connection string Secret created in the central cluster did not carry a controller owner reference to the MongoDBUser CR. The missing reference prevented Kubernetes garbage collection from cleaning up the Secret when the MongoDBUser was deleted.
  • MongoDBUser: Fixed a bug where the ownership guard on the connection string Secret was always satisfied regardless of the actual owner, allowing the operator to silently overwrite a Secret controlled by a different resource.
  • Fixed a bug where all MongoDBCommunity deployment telemetry rows incorrectly reported IsRunningEnterpriseImage = true. The field was being evaluated against the operator-level enterprise image rather than the image configured in each CR's spec, causing a misleading ~100% enterprise rate for the Community deployment type.
  • IsRunningEnterpriseImage for Community deployments is now derived from the mongod container image override in spec.statefulSet.spec.template.spec.containers, if present. When no override is set, the field correctly defaults to false, reflecting that Community CRs use the community MongoDB server image by default.
  • MongoDBOpsManager, AppDB: Fix for spec.applicationDatabase.agent.monitoringAgent.logRotate field not being
    handled properly. Additionally, added defaults for
    spec.applicationDatabase.agent.monitoringAgent.logRotate.sizeThresholdMB to 1000 and
    spec.applicationDatabase.agent.monitoringAgent.logRotate.timeThresholdHrs to 24, which are same defaults Ops Manager
    would set.
  • MongoDBSearch: The default JVM heap size (half of the memory request) is now capped at 30GB, following the mongot sizing guidance. Heap sizes above ~30GB prevent the JVM from using compressed object pointers and degrade performance. User-provided heap flags are not affected, if more than 30GB heap is required, we recommend using jvmFlags.

Other Changes

  • MongoDBSearch: The operator no longer requires any opt-in to reconcile multi-cluster MongoDBSearch resources. The internal MDB_SEARCH_ENABLE_MULTI_CLUSTER pre-GA feature gate has been removed; multi-cluster reconciliation is now always enabled.

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.

1 participant