There is a chance that Zoekt index will remain in the overprovisioned watermark_level

Background

We update the watermark_level of each index by this worker UpdateIndexUsedStorageBytesEventWorker

But this worker runs on a scope with_stale_used_storage_bytes_updated_at. If an index's used_storage_bytes does not receive any update, its watermark_level will remain as it is. It is not always healthy. We have a lot of indices which are overprovisioned and will remain until their used_storage_bytes get updated. It is not ideal that the index's watermark_level is not healthy.

Proposal

Run update_storage_bytes_and_watermark_level but without refresh_used_storage_bytes on the indices whose used_storage_bytes are not stale. refresh_used_storage_bytes is an expensive method and since index's storage_bytes is up-to-date, there is no need to run it.

Edited by Ravi Kumar