Skip to content

Update search code to use Replica

Ravi Kumar requested to merge 467407-update-search-to-use-replia into master

What does this MR do and why?

Update the .search? method to check if Replica is ready if the search non Project and feature flag zoekt_search_with_replica is enabled for a namespace. Override the zoekt_node_id method. This method will return super if feature zoekt_search_with_replica is disabled or the node size is 1. Else it will return nil which will enable the search_multi_node search.

Since by default, the feature flag is enabled in test mode, the group-level search tests were failing. So, I had to move all the replicas to the ready state to make the test pass.

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

Numbered steps to set up and validate the change are strongly suggested.

Query plan:

SELECT
    1 AS one
FROM
    "zoekt_replicas"
WHERE
    "zoekt_replicas"."state" = 10
    AND "zoekt_replicas"."namespace_id" = 9970
LIMIT 1

https://console.postgres.ai/shared/b49bd0fd-ebfe-4b7e-aa1e-72115cd6c69b

Related to #467407 (closed)

Edited by Ravi Kumar

Merge request reports