Add zoekt index watermark level update callback

What does this MR do and why?

This merge request introduces changes to improve the management of storage and watermark levels in the Zoekt search indexing system. The main updates include:

  1. Adding a new callback to automatically set the watermark level before saving an index, but only when storage-related attributes have changed.
  2. Removing the manual setting of the watermark level in the update_reserved_storage_bytes! method, as it's now handled by the new callback.
  3. Introducing helper methods to determine if storage bytes have changed and to set the appropriate watermark level.
  4. Updating the test suite to reflect these changes, particularly in how mismatched watermark levels are created for testing purposes.

These changes aim to streamline the process of managing storage and watermark levels, reducing the chances of inconsistencies and improving the overall reliability of the indexing system.

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

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.

Merge request reports

Loading