When SonarQube restarts in disaster recovery mode, It triggers an asynchronous elasticsearch re-indexation. We rely on the project_branches table to find items to index. On a corrupted dataset, we may find a project_branches with a main_component_uuid that does not correspond to an existing component. In that case, the CE task stays in the pending state forever, preventing users to use global issues page as well as the page of the project which is concerned.
The process should:
- Not ignore tasks that are bound to an orphan branch
- Purge orphan branch during the processing, as a pre-computational step (Indexation step skip non-existing branch)