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
- setup gdk for elasticsearch
- mark a migration manually as not run, in rails console
Elastic::DataMigrationService.migrations.last.save!(completed: false) - run
gitlab:elastic:info - run
gitlab:elastic:list_pending_migrations - ensure that the migration is returned in both tasks
- clear redis cache:
bundle exec rake cache:clear - turn elasticsearch indexing off
ApplicationSetting.update!(elasticsearch_indexing: false) ApplicationSetting.last.elasticsearch_indexing # confirm - run
gitlab:elastic:info - run
gitlab:elastic:list_pending_migrations - ensure both do not return pending migrations
Edited by Terri Chu