Skip to content

KUBE-169: Simplify shared MongoDB Search query snippets#1378

Open
anandsyncs wants to merge 3 commits into
masterfrom
anandsyncs-simplify-shared-search-query-snippets
Open

KUBE-169: Simplify shared MongoDB Search query snippets#1378
anandsyncs wants to merge 3 commits into
masterfrom
anandsyncs-simplify-shared-search-query-snippets

Conversation

@anandsyncs

@anandsyncs anandsyncs commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Simplifies the shared replica-set and sharded MongoDB Search query snippets while keeping public commands customer-friendly.

  • Keeps readiness polling internal to CI.
  • Replaces the fixed wait with a public index-status check.
  • Preserves published scenario 03 filenames.
  • Keeps CI-only non-empty-result assertions out of public snippets.

Jira: KUBE-169

Stack: 1/3. Followed by the replica-set and sharded multi-cluster Search snippet PRs.

Extracted from #1368.

Evergreen proof

Full-stack Search snippets patch passed all nine Search snippet tasks: seven single-cluster and two multi-cluster.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@anandsyncs
anandsyncs requested a review from a team as a code owner July 15, 2026 14:25
@anandsyncs anandsyncs changed the title Simplify shared MongoDB Search query snippets KUBE-169: Simplify shared MongoDB Search query snippets Jul 15, 2026
@github-actions

github-actions Bot commented Jul 15, 2026

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.

@viveksinghggits viveksinghggits left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks pretty good, left small comments.

Comment thread docs/search/03-search-query-usage/README.md Outdated
Comment thread docs/search/03-search-query-usage/README.md Outdated
Comment thread docs/search/03-search-query-usage/README.md Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR simplifies the shared MongoDB Search query-usage snippet modules (replica set + sharded) by separating CI-only readiness behavior from customer-facing steps and by making the “wait” step a public index-status inspection rather than a fixed sleep.

Changes:

  • Updates the sharded query-usage harness to run an internal readiness poll and then a public getSearchIndexes() status check.
  • Refactors query snippets to execute mongosh directly via kubectl exec heredocs (removing the intermediate “write JS to /tmp” pattern).
  • Adds/updates READMEs to make scenario handoff and quick-run instructions clearer for single- and multi-cluster flows.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
docs/search/08-search-sharded-query-usage/test.sh Switches from the old internal wait to a new internal wait + public index listing before queries.
docs/search/08-search-sharded-query-usage/README.md Rewrites sharded query-usage instructions and documents multi-cluster handoff.
docs/search/08-search-sharded-query-usage/code_snippets/08_0455_execute_vector_search_query.sh Runs vector search via inline kubectl exec … mongosh heredoc and simplifies query vector selection.
docs/search/08-search-sharded-query-usage/code_snippets/08_0450_execute_search_query.sh Runs text search via inline kubectl exec … mongosh heredoc.
docs/search/08-search-sharded-query-usage/code_snippets/08_0440_list_search_indexes.sh New public snippet to list/inspect index status for both collections.
docs/search/08-search-sharded-query-usage/code_snippets/08_0440_internal_wait_for_search_indexes.sh Removes the prior internal polling implementation.
docs/search/08-search-sharded-query-usage/code_snippets/08_0439_internal_wait_for_search_indexes.sh New internal polling snippet using getSearchIndexes() to wait for READY.
docs/search/03-search-query-usage/test.sh Adds internal readiness polling and gates auto-embed listing based on EMBEDDING_MODEL.
docs/search/03-search-query-usage/README.md New replica-set query-usage README with handoff and quick-run guidance (incl. multi-cluster).
docs/search/03-search-query-usage/code_snippets/03_0456_execute_auto_embed_vector_search_query.sh Switches to inline kubectl exec … mongosh heredoc execution.
docs/search/03-search-query-usage/code_snippets/03_0455_execute_vector_search_query.sh Switches to dynamic query vector selection (instead of a large inline literal) and updates projection/limits.
docs/search/03-search-query-usage/code_snippets/03_0450_execute_search_query.sh Switches to inline kubectl exec … mongosh heredoc execution.
docs/search/03-search-query-usage/code_snippets/03_0440_wait_for_search_index_ready.sh Replaces a fixed sleep with a public getSearchIndexes() status printout.
docs/search/03-search-query-usage/code_snippets/03_0439_internal_wait_for_search_indexes.sh New internal polling snippet to wait for relevant indexes to reach READY (incl. optional auto-embed).
docs/search/03-search-query-usage/code_snippets/03_0420_import_movies_mflix_database.sh Splits the import into explicit curl + mongorestore execs (no temp script).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/search/08-search-sharded-query-usage/README.md
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Use this label in Pull Request to not require new changelog entry file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants