Update "Index all projects" to allow end to end instance indexing
Problem to solve
Currently, the Index all projects
button is quite misleading. When it's pressed, GitLab doesn't create required indices, but only schedules indexing for a subset of data, which is not what admins expect.
Original description
Problem
At present there are several admin rake tasks and buttons on the admin UI for managing the Elasticsearch cluster. These cause a lot of confusion and admins tend to just try everything when they are having any data issue or running into any problems. If we don't make the options clearer or safer then these things can make things worse for the admin or at best just waste a lot of their time.
One particular issue is the "Index all projects" button on the admin UI. This is really only intended to be used when indexing projects for the first time (after adding the Elasticsearch cluster). After that it basically does nothing, because it doesn't clear the IndexStatus
of the projects so it won't recover missing data in the index (depending on why it's missing). This button is also very easily confused with "reindexing" which is the process of re-running all the Elasticsearch data again through to a new index to update Elasticsearch configuration (nothing to do with correcting missing data).
In general I think we should have less of the kind of "rescue me from broken Elasticsearch" options in our UI and possibly we should be expanding just general reporting of what's going on to help us better diagnose and fix bugs in the product itself.
But for this particular button we probably don't even need it all. At present the user needs to run a rake task the first time to create the Elasticsearch index. So, at that point, they may as well run the full gitlab:elastic:index
rake task which triggers the indexing as well and then they never need to press this button.
We could also look longer term to avoid any need for rake tasks but that can be a separate priority to this.
Solution
Remove the button from the admin UI and document that you need to run the rake task to trigger the first index.
Proposal
We should make this button functionally equivalent to the gitlab:elastic:index
rake task so that by pressing this button, admins could trigger index creation and indexing/re-indexing of the instance.
Release notes
We have replaced Index all projects
button in the Search Admin Settings with a new button named Index the instance
. This new button achieves the functionality parity with the gitlab:elastic:index
rake task. When Advanced Search is enabled on the GitLab instance, clicking the button will index all supported types of data into the integrated Elasticsearch or OpenSearch cluster.