Skip to content

Handle orphaned zoekt indices

John Mason requested to merge jm-handle-orphaned-zoekt-indices into master

What does this MR do and why?

The state management in introduced in this MR will help us remove orphaned indices. This is part of the effort in this epic: &14886 (closed)

New Scopes Query Plans

Search::Zoekt::Index.should_be_marked_as_orphaned
SELECT "zoekt_indices".* FROM "zoekt_indices" WHERE ("zoekt_indices"."zoekt_enabled_namespace_id" IS NULL OR "zoekt_indices"."zoekt_replica_id" IS NULL) AND "zoekt_indices"."state" NOT IN (230, 240)

https://postgres.ai/console/gitlab/gitlab-production-main/sessions/31375/commands/97385

Search::Zoekt::Index.should_be_deleted
SELECT "zoekt_indices".* FROM "zoekt_indices" WHERE "zoekt_indices"."state" IN (230, 240)

https://postgres.ai/console/gitlab/gitlab-production-main/sessions/31375/commands/97386

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.

Edited by John Mason

Merge request reports

Loading