Skip to content

Fix: Revert unintended bulk sink changes that broke test case search indexing#27202

Merged
mohityadav766 merged 1 commit into1.12.5from
fix/revert-extra-bulk-sink-changes-1.12.5
Apr 9, 2026
Merged

Fix: Revert unintended bulk sink changes that broke test case search indexing#27202
mohityadav766 merged 1 commit into1.12.5from
fix/revert-extra-bulk-sink-changes-1.12.5

Conversation

@sonika-shah
Copy link
Copy Markdown
Collaborator

Summary

Problem

Commit 2839bc259f changed the bulk sink serialization path from:

// Before (correct — matches main)
String json = JsonUtils.pojoToJson(searchIndexDoc);
document(EsUtils.toJsonData(json));  // Date → ISO string via Jackson

to:

// After (broken — from PR #27153)
JsonData jsonData = EsUtils.toJsonData(searchIndexDoc);  // Date → epoch Long, bypasses Jackson
document(jsonData);

This caused java.util.Date fields (like tags.appliedAt) to be sent as raw epoch Long during reindex. OpenSearch dynamically mapped tags.appliedAt as long. Later, real-time indexing sent appliedAt as ISO string → mapper_parsing_exception:

failed to parse field [tags.appliedAt] of type [long]
Preview of field's value: '2026-04-09T01:51:10.000160Z'

Test cases with tags were created in DB but silently never indexed in search, causing DataQuality.spec.ts > TestCase filters to fail.

Files restored

File What was reverted
ElasticSearchBulkSink.java Back to pojoToJson → string → toJsonData(string)
OpenSearchBulkSink.java Same
EsUtils.java Removed toJsonData(Object) overload
OsUtils.java Same
SearchIndexExecutor.java Removed contextDataCache, Thread.MIN_PRIORITY
ReindexingMetrics.java Removed counter caching

Test plan

  • Reindex after deployment to recreate indices with correct dynamic mappings
  • Run DataQuality.spec.ts > TestCase filters — should pass
  • Verify no mapper_parsing_exception errors in server logs for tags.appliedAt
  • Verify test cases with tags appear in search results after creation

@github-actions github-actions bot added backend safe to test Add this label to run secure Github workflows on PRs labels Apr 9, 2026
…e test case search indexing

Commit 2839bc2 cherry-picked PR #27153 ("Improve memory usage for
reindex") to 1.12.5, bundled with the revert of PR #27103. PR #27153
is still open/unmerged on main and introduced extra file changes
that were never meant for 1.12.5.

The bulk sink change from toJsonData(json_string) to
toJsonData(map_object) bypassed Jackson's WRITE_DATES_AS_TIMESTAMPS=false
setting. During reindex, java.util.Date fields (like tags.appliedAt)
were sent as raw epoch Longs instead of ISO strings. OpenSearch
dynamically mapped tags.appliedAt as "long". Later, real-time indexing
(test case creation via API) sent appliedAt as ISO string — OpenSearch
rejected it with mapper_parsing_exception. Test cases with tags were
created in DB but silently never indexed in search.

Changes:
- ElasticSearchBulkSink/OpenSearchBulkSink: reverted serialization
  back to pojoToJson → string → toJsonData(string), kept Thread.MIN_PRIORITY
- EsUtils/OsUtils: removed toJsonData(Object) overload
- SearchIndexExecutor: removed contextDataCache, kept Thread.MIN_PRIORITY
- ReindexingMetrics: removed counter caching

Requires reindex after deployment.
@sonika-shah sonika-shah force-pushed the fix/revert-extra-bulk-sink-changes-1.12.5 branch from 8fdeaae to bce38b9 Compare April 9, 2026 10:00
@gitar-bot
Copy link
Copy Markdown

gitar-bot bot commented Apr 9, 2026

Code Review ✅ Approved

Reverts unintended bulk sink changes that were breaking test case search indexing. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@mohityadav766 mohityadav766 merged commit 2784034 into 1.12.5 Apr 9, 2026
16 of 35 checks passed
@mohityadav766 mohityadav766 deleted the fix/revert-extra-bulk-sink-changes-1.12.5 branch April 9, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants