The mark_all_as_completed! method to drop halted cache and save halted as false
What does this MR do and why?
This MR changes the mark_all_as_completed! method to overwrite the halted state (because it should be marked as complete) and also drop the cache for whether a migration has halted.
I noticed this inconsistency in a customer support ticket when debugging another issue.
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- enable advanced search
- stop rails background jobs:
gdk stop rails-background-jobs - open a rails console, and recreate the migrations index
helper = Gitlab::Elastic::Helper.default helper.delete_migrations_index helper.create_migrations_index - run the first migration:
Elastic::MigrationWorker.new.perform - load the admin ui: http://gdk.test:3000/admin/application_settings/search#js-elasticsearch-settings
- you will see two notifications, 1 at the top for pending migrations and 1 in Advanced search for a halted migration
- mark all migrations as complete:
::Elastic::DataMigrationService.mark_all_as_completed! - the pending migration message should be gone
- the halted migration message should be gone (on master, this message would stay around forever, even if the cache expired)
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Terri Chu