Skip to content

Remove container routing in remove_wikis_from_the_standalone_index

What does this MR do and why?

This MR will remove the container routing in the remove_wikis_from_the_standalone_index. The container routing might be stale in some cases. For instance: A project using elasticsearch at the start. It has wikis indexed. Later on, the project did not use Elasticsearch anymore. Now this project is moved to another namespace. Now if we call the ElasticDeleteProjectWorker, it will not delete the wikis because it will find them in the old namespace routing which is wrong. This MR does the routing only if namespace_routing_id is passed exclusively.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  1. Ensure the elasticsearch is enabled.
  2. Enable the selective elasticsearch indexing
  3. Select a namespace with project for which elasticsearch is enabled.
  4. Create some wikis inside this project.
  5. Ensure on Elasticsearch that wiki documents exist
  6. Remove this namespace from the elastic_indexed_namespaces list.
  7. Now move this project to a different namespace
  8. Now run the following command in the rails console. Replace project_id with the one you have chosen in the first step.
ElasticWikiIndexerWorker.new.perform(project_id, 'Project', force: true)
  1. Check on Elastic that the documents are removed.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #428311 (closed)

Edited by Ravi Kumar

Merge request reports