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
- Ensure the elasticsearch is enabled.
- Enable the selective elasticsearch indexing
- Select a namespace with project for which elasticsearch is enabled.
- Create some wikis inside this project.
- Ensure on Elasticsearch that wiki documents exist
- Remove this namespace from the elastic_indexed_namespaces list.
- Now move this project to a different namespace
- 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)
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #428311 (closed)