dotCMS / dotCMS/core

OpenSearch: create-index REST path logs raw stack traces instead of clean retry/give-up when OS is down

Open
#36,420 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

OKR : Customer Support Team : Scout Type : Defect
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Problem Statement

During QA of the ES→OpenSearch migration (surfaced by #36218, test case TC-038; part of epic #35476), the index-create REST path logs raw stack traces instead of the clean retry/give-up used elsewhere when OpenSearch is unreachable.

In Phase 1 with OpenSearch stopped, PUT /api/v1/esindex/create/shards/1 returns HTTP 200 and does not block (ES is unaffected — correct, non-blocking behavior). But it logs ~94 raw UnknownHostException stack traces from MappingOperationsOS.putMapping. The reindex/startup path handles the identical condition cleanly via waitUtilIndexReady()handleConnectionExhausted() ("OpenSearch Connection Attempt #N of N" then a single graceful fallback line). The create-index path bypasses that reachability/give-up handling.

Impact: log noise only — behavior is correct. Makes triage harder (a wall of stack traces for an expected, handled condition).

Steps to Reproduce

Rig: docker/docker-compose-examples/single-node-os-migration/, Phase 1, OpenSearch reachable at start.

  1. Confirm Phase 1 is active (shadow .os indices present).
  2. Stop the new engine: docker compose stop opensearch3.
  3. curl -u admin@dotcms.com:admin -X PUT http://localhost:8082/api/v1/esindex/create/shards/1
  4. Watch the dotCMS log.

Observed: create returns HTTP 200 (no hang, ES unaffected), but the log fills with ~94 UnknownHostException stack traces from MappingOperationsOS.putMapping — no Connection Attempt #N, no single give-up line.

Expected (as on the reindex path):

ERROR OpenSearch Connection Attempt #1 of N: ...
ERROR OpenSearch is not reachable after N attempt(s)... falling back to ES-only...

Acceptance Criteria

  • With OpenSearch down in Phase 1, PUT /api/v1/esindex/create logs a single actionable error (or the same Connection Attempt/give-up sequence as the reindex path) rather than raw repeated stack traces.
  • Behavior remains non-blocking: request still succeeds on ES; ES operations unaffected.

dotCMS Version

dotcms/dotcms:latest (verified against release 26.06.30-01), single-node-os-migration rig, migration Phase 1.

Severity

Low - Minor issue or cosmetic

Links

NA — surfaced by QA of #36218 (epic #35476).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at MappingOperationsOS.putMapping and compare the create-index flow with waitUtilIndexReady() and handleConnectionExhausted(), using TC-038 and the single-node-os-migration Docker rig to reproduce the stopped-OpenSearch case. Done means the REST request remains non-blocking and ES succeeds while logs show one actionable retry/give-up sequence rather than repeated raw UnknownHostException traces.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend, observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.