Commit e0fbb1d
## Proposed Changes
The two diagnostics/robustness follow-ups tracked in #36237 (the
bootstrap-idempotency fix is #36238). Both target the same incident
class where a migration startup problem silently degraded into a
confusing downstream symptom.
### 1. `ContentletIndexAPIImpl.checkAndInitializeIndex()` — fail loudly
during migration
The catch-all swallowed **every** bootstrap exception — including the
Phase 3 `DotRuntimeException` that is thrown a few lines above
specifically to "abort loudly". The instance then came up
**half-initialised**, and the read provider queried an
unfinished/missing index, surfacing downstream as `all shards failed`.
Now, when a migration is active (`isMigrationStarted() ||
isReadEnabled() || isMigrationComplete()`), the failure is re-thrown to
abort startup so the operator restores connectivity/config and restarts.
**Legacy ES-only installs (migration not started) keep the historical
best-effort boot** — no behavior change for non-migration deployments.
### 2. `ContentFactoryIndexOperationsES` — surface the per-shard root
cause
Both the search and count catch blocks logged only
`e.getCause().getMessage()`, hiding the actionable detail behind the
generic `search_phase_execution_exception / all shards failed` wrapper.
Added `describeEsFailure(ElasticsearchException)` which renders:
- `getDetailedMessage()` (full ES type/reason chain),
- the per-shard `ShardSearchFailure` reasons (capped at 5, with an "...
and N more" summary),
- any suppressed server-side causes.
The enriched message still contains the substrings
`shouldQueryCache(...)` keys off, so the error-caching behavior is
unchanged.
## Testing
- `./mvnw compile -pl :dotcms-core` (JDK 25) — compiles clean.
- No public/interface signatures changed.
## Relationship to other PRs
- #36238 — makes index bootstrap idempotent (removes the most common
trigger of the swallowed failure). This PR is the defense-in-depth +
observability layer on top; the two are independent and can merge in any
order.
Part of #36237 (does not close it — the parent issue is also addressed
by #36238).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b4216cb commit e0fbb1d
2 files changed
Lines changed: 58 additions & 3 deletions
File tree
- dotCMS/src/main/java/com/dotcms/content/elasticsearch/business
Lines changed: 45 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
86 | 129 | | |
87 | 130 | | |
88 | 131 | | |
| |||
105 | 148 | | |
106 | 149 | | |
107 | 150 | | |
108 | | - | |
| 151 | + | |
109 | 152 | | |
110 | 153 | | |
111 | 154 | | |
| |||
171 | 214 | | |
172 | 215 | | |
173 | 216 | | |
174 | | - | |
| 217 | + | |
175 | 218 | | |
176 | 219 | | |
177 | 220 | | |
| |||
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
521 | 521 | | |
522 | 522 | | |
523 | 523 | | |
524 | | - | |
| 524 | + | |
525 | 525 | | |
526 | 526 | | |
527 | 527 | | |
| |||
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
557 | 569 | | |
558 | 570 | | |
559 | 571 | | |
| |||
0 commit comments