Details
Description
SYMPTOM:
As per https://help.sonatype.com/repomanager3/planning-your-implementation/resiliency-and-high-availability/single-data-center-on-premises-deployment-example-using-kubernetes#SingleDataCenterOnPremisesDeploymentExampleUsingKubernetes-ExampleYAMLFiles, set "NEXUS_SEARCH_INDEX_REBUILD_ON_STARTUP" with the value "ture", but the repository.rebuild-index task was not run.
REPRODUCE STEPS:
Would not need to prepare K8s environment.
- Install NXRM 3.37.x
- Before starting "export NEXUS_SEARCH_INDEX_REBUILD_ON_STARTUP=true"
- Start Nexus
EXPECTED BEHAVIOUR:
- If new installation (or a new Pod starting), regardless of NEXUS_SEARCH_INDEX_REBUILD_ON_STARTUP, Nexus should rebuild the index because of "nexus.elasticsearch.autoRebuild" uses "true" for default.
- If all indexes are empty, then with NEXUS_SEARCH_INDEX_REBUILD_ON_STARTUP=true, Nexus should rebuild indexes.
POTENTIAL CAUSE:
- It seems Nexus is supposed to check if index is empty, but checking if index exists. Because indexes are created during the startup from SearchIndexServiceImpl#createIndex (but empty), the SearchIndexServiceImpl#indexExist becomes true.
- If one repository returns true from the indexExist, it looks like Nexus stops checking other repositories.