Skip to content

Remove excess zoekt replicas

What does this MR do and why?

Removes excess zoekt replicas.

AI Summary

This code adds a new automated cleanup system for a search feature called Zoekt. The system monitors search replicas (copies of data used for faster searching) and automatically removes excess ones when there are too many.

Here's what it does:

  1. Adds monitoring: Creates a new background check that runs periodically to identify namespaces (groups/projects) that have more search replicas than they're supposed to have.

  2. Adds cleanup logic: When excess replicas are found, the system automatically deletes the extra ones to bring the count back to the desired number. Each namespace can have either a custom replica limit or use a default setting.

  3. Processes in batches: To avoid overwhelming the system, it processes up to 100 namespaces at a time and schedules follow-up work if more cleanup is needed.

  4. Includes safety measures: The system logs how many replicas were removed and includes comprehensive tests to ensure it works correctly in various scenarios.

The main benefit is that this prevents storage waste and maintains optimal performance by ensuring search replicas don't accumulate beyond what's actually needed. It's a "set it and forget it" solution that runs automatically in the background.

References

#565775

Screenshots or screen recordings

Before After

How to set up and validate locally

MR acceptance checklist

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

Edited by John Mason

Merge request reports

Loading