Replica search is not respecting the search field of enabled_namespace

What does this MR do and why?

Change the scope for_namespace to for_root_namespace_id_with_search_enabled. This new scope will also check the search: true

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  • Set up Zoekt for a namespace.
  • Enable the FF zoekt_search_with_replica.
  • Set the search field in the zoekt_enabled_namespace to false
  • Now perform a group level search in this namespace. It should not use Zoekt

Query

SELECT
    1 AS one
FROM
    "zoekt_replicas"
    INNER JOIN "zoekt_enabled_namespaces" "zoekt_enabled_namespace" ON "zoekt_enabled_namespace"."id" = "zoekt_replicas"."zoekt_enabled_namespace_id"
WHERE
    "zoekt_enabled_namespace"."search" = TRUE
    AND "zoekt_replicas"."namespace_id" = 9970
    AND "zoekt_replicas"."state" = 10
LIMIT 1

https://console.postgres.ai/shared/3fae56e9-7105-448e-966f-5ebaef18e41d

Related to #479328 (closed)

Edited by Ravi Kumar

Merge request reports

Loading