Remove orphaned commits from Advanced Search index
What does this MR do and why?
Closes #327829 (closed)
This migration removes commits that were associated to a project that no longer exists in Advanced Search index.
Because there are currently 56,140,808
orphaned commits, the delete_by_query
may take some time, so the timeout is set to 3d
. Elasticsearch will internally create batch sizes and execute each of them until all documents that match the query are deleted. Documentation: https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html#docs-delete-by-query-api-desc
This migration will run before the commits permissions migration. Otherwise, the commits permissions migration will never think it has fully completed because there are commits that still don't have visibility levels (because they are orphaned).
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.