fix(opensearch): prevent ES index recreation and spurious reads in Phase 3#35356
fix(opensearch): prevent ES index recreation and spurious reads in Phase 3#35356fabrizzio-dotCMS merged 2 commits intomainfrom
Conversation
…ase 3 In Phase 3 (OS only), indexReady() still required ES indices to be ready, causing initIndex() to be triggered and recreating ES indices when none existed. Every checkAndInitializeIndex() cycle also queried the decommissioned ES cluster via indexReadyES(). - indexReady(): short-circuit to indexReadyOS() when isMigrationComplete() - initIndex(): guard esNeeded with !isMigrationComplete() to never bootstrap ES in Phase 3 - BulkProcessorListener: resolve primary IndexTag from current phase so Phase 3 reindex logs show [OS] instead of [ES] and the correct config gate (REINDEX_BULK_LOG_OS_PROVIDER) applies Closes #34934 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Claude finished @fabrizzio-dotCMS's task in 2m 27s —— View job PR Review
The logic is correct and the short-circuit evaluation works as intended. A few things worth flagging: 1. Stale javadoc on The method's doc still says:
Phase 3 now only creates OS indices. That bullet needs to be split:
2. Double read of
3. The no-arg constructor reads 4. No unit tests for Phase 3 guards
The core fix is sound — |
Summary
In Phase 3 (
PHASE_3_OPENSEARCH_ONLY) the system was still checking ES index readiness on everycheckAndInitializeIndex()cycle, querying the decommissioned ES cluster and recreating ES indices when none existed. This PR adds three Phase 3 guards to stop all unintended ES traffic.Closes #34934
Changes
ContentletIndexAPIImplindexReady(): short-circuits toindexReadyOS()whenisMigrationComplete()— no longer callsindexReadyES()in Phase 3initIndex(): guardsesNeededwith!isMigrationComplete()sobootstrapAndPointnever creates ES indices in Phase 3BulkProcessorListenerIndexTagfromMigrationPhase.current()— Phase 3 reindex logs now correctly show[OS]instead of[ES], and the config gateREINDEX_BULK_LOG_OS_PROVIDERapplies instead of the ES oneTesting
FEATURE_FLAG_OPEN_SEARCH_PHASE=3[OS]prefixBreaking Changes
None.
🤖 Generated with Claude Code