Show a warning if the ES index is created before 13.1
Problem
Since Advanced Search migrations and Zero downtime reindexing only work with Elasticsearch indices that were created after 13.1, we might want to alert instance admins that they use an obsolete index.
Introduced here: !71609 (merged)
Proposal
At the top of the Advanced Search settings page we should show such warning if we detect that gitlab-production
doesn't use aliases. This can be accomplished by using the Gitlab::Elastic::Helper.default.alias_exists?
method in ee/lib/gitlab/elastic/helper.rb and creating a before_action
for :advanced_search
only in ee/app/controllers/ee/admin/application_settings_controller.rb. And set the flash warning there.
flash[:warning] = _('Your Elasticsearch index must first use aliases before using Zero downtime reindexing and Advanced Search migrations. Please recreate your index from scratch.')
This feature would probably have helped with the customer ticket discussed in https://gitlab.slack.com/archives/C3TMLK465/p1619519634034100 (internal GitLab link)