Skip to content

Refactor elasticsearch task status for reindexing

Terri Chu requested to merge tchu-add-elastic-tasks-service into master

What does this MR do and why?

Related to #390118

Creates a new class to ease use of Elasticsearch task status from the cluster. Having one class will make it easier to adjust to changes in the underlying API if any changes happen during major version upgrades.

Initially the class is only used in the ClusterReindexingService. The plan is to use this new class in future Advanced search migrations and eventually in all existing places (in future MRs).

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

N/A

How to set up and validate locally

  1. Enable elasticsearch in gdk

  2. Setup advanced search and index everything

  3. Trigger a Zero downtime reindexing

  4. You can track and push the reindexing task along quicker in the rails console by running these commands (if you wait, you'll need to wait for the cronworker to move the process along and it can take longer)

      Elastic::ReindexingTask.current # check on the current state of the task
      ::Elastic::ClusterReindexingService.new.execute # move the reindexing task along
  5. you can refresh the admin ui to get a visual update on the progress as well

success!

image

Edited by Terri Chu

Merge request reports