Only check pending migrations if indexing enabled

What does this MR do and why?

This affects anywhere Elastic::DataMigrationService.pending_migrations is called.

The method will now return an empty array if elasticsearch_indexing application setting is false

Having this check return pending migrations when indexing is enabled has caused confusion for self managed customers.

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Rake tasks only

How to set up and validate locally

  1. setup gdk for elasticsearch
  2. mark a migration manually as not run, in rails console
      Elastic::DataMigrationService.migrations.last.save!(completed: false)
  3. run gitlab:elastic:info
  4. run gitlab:elastic:list_pending_migrations
  5. ensure that the migration is returned in both tasks
  6. clear redis cache:
      bundle exec rake cache:clear
  7. turn elasticsearch indexing off
      ApplicationSetting.update!(elasticsearch_indexing: false)
      ApplicationSetting.last.elasticsearch_indexing # confirm
  8. run gitlab:elastic:info
  9. run gitlab:elastic:list_pending_migrations
  10. ensure both do not return pending migrations
Edited by Terri Chu

Merge request reports

Loading