Updating Elasticsearch URL not creating all Elasticsearch indexes
Summary
When working on #296032 (closed), I found an issue where we only checked and created one index, while we should make sure all the indexes to exist, gitlab-<environment>, gitlab-<environment>-issues, and gitlab-<environment>-migrations.
Steps to reproduce
- Delete Elasticsearch indexes, by running rake task
bundle exec rake gitlab:elastic:delete_index
- Make sure Elasticsearch is enabled on Admin settings.
- Change the Elasticsearch URL to any non-existing address, then change it back to a correct one
- We should see all three indexes got created. But, there's only one.
What is the current bug behavior?
Only gitlab-<environment> index is created when updating Elasticsearch URL.
What is the expected correct behavior?
All Elasticsearch indexes should be created when updating Elasticsearch URL.
Possible fixes
Make sure all Elasticsearch indexes got created if they don't exist when making changes to Elasticsearch URL.