Hi everyone! ![]()
I’m facing a question about how SonarQube handles reindexing, and I’d like to confirm whether the scenario below is supported or if it can lead to inconsistencies.
Recently, I had to delete the data/es* folder to force a full reindex, but the process took more than 48 hours and never completed.
Because of this, we started keeping copies of the data/ directory to avoid having to reindex everything from scratch in case something goes wrong.
Here’s my question:
If, for example, the indexes are deleted on December 1st, but I restore an old copy of the data/ folder from August, while the database is fully up to date, will SonarQube be able to automatically complete the missing indexes from the current database data?
Or could this cause errors or inconsistencies (divergent indexes, incorrect data, Elasticsearch failures, etc.)?
Environment
-
SonarQube version: Community 9.9.3 LTS
-
Database: PostgreSQL 12.7 (external instance)
-
Orchestration: GKE (Kubernetes) – GCP
-
Resources:
-
1 node
e2-standard-16(16 vCPUs, 64 GB RAM) -
Boot disk 100 GiB
pd-balanced(zonal) -
Regional SSD Persistent Disk 50 GiB (used for SonarQube data directories, including Elasticsearch indexes)
-
What I’ve observed
-
After deleting
data/es*, the reindex process becomes extremely slow (over 48 h without completion). -
The
es.logshows activity, but progress is minimal even with a regional SSD disk. -
Heap size is correctly configured (~16 GB).
-
Only one SonarQube instance is connected to the database.
Main questions
-
Can SonarQube detect and automatically fix outdated indexes (for example, from an old
data/backup) and complete them using the current database data? -
If not supported, is there a real risk of inconsistency (for example, outdated mappings or references that no longer exist in the DB)?
-
Are there official best practices to speed up a full reindex (e.g., heap tuning, I/O configuration, hardware recommendations, housekeeping)?
-
Does reducing data retention (via housekeeping settings) actually help shorten reindex time for large instances?
-
In case the
data/folder is lost, is the recommended procedure still to completely delete the indexes and let SonarQube rebuild them from scratch using the database?
I can share es.log and ce.log excerpts and I/O statistics if needed.
Thanks in advance to anyone who can confirm the expected behavior or share recommendations to make reindexing more efficient! ![]()