Fix ElasticDeleteProjectWorker delete commits, index_status
This `ElasticDeleteProjectWorker` is a sidekiq worker that is responsible for clearing project data out of our Elasticsearch index. It does this using a [Delete by query]( https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html ) which attempts to find all associated (child records) for the project and delete them as well as the project This MR fixes 2 problems with `ElasticDeleteProjectWorker`: 1. Previously this worker was not correctly deleting commits as they did not have a `project_id` https://gitlab.com/gitlab-org/gitlab/-/issues/327829. We do have a `commit.rid` which is the `project_id` set so we need to use this in our `delete_by_query` 2. We had another weird bug https://gitlab.com/gitlab-org/gitlab/-/issues/259721 where we were not correctly clearing `index_status` after running this worker. When this worker was created this made sense because it was only used when a project was deleted. But on GitLab.com we also use this when a project subscription expires. Therefore any projects that had expired subscriptions then later renewed were considered to already be indexed based on index_status which caused most of the repository to be missed.
Showing
Please register or sign in to comment