Commit 2acf52f
fix(search): treat stale parentOf as warning during time-series reindex (open-metadata#27417) (open-metadata#27800)
* fix(search): treat stale parentOf as warning during time-series reindex (open-metadata#27417)
Time-series records (testCaseResolutionStatus, testCaseResult, ...) whose
parentOf entity_relationship row is missing surface as
"does not have expected relationship parentOf to/from entity type ..."
from EntityRepository.ensureSingleRelationship and were failing the entire
reindex batch. Mirror the warning-vs-failure split already used for
EntityInterface sources: extract isEntityNotFoundError into ReindexingUtil,
broaden it to match the relationship-not-found message, and apply the same
partitioning to PaginatedEntityTimeSeriesSource.read/readWithCursor/
readNextKeyset so orphaned rows are counted as warnings via
result.getWarningsCount() instead of failing the job.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* review: tighten matcher, propagate warnings on cursor/keyset paths
Address PR open-metadata#27800 review:
- Drop bare "not found" from isEntityNotFoundError; add "entity not found"
so we still match EntityNotFoundException's "Entity not found:" form but
no longer misclassify "Column 'foo' not found in result set" or
"SSL certificate not found" as warnings.
- Call updateStats(success, failed, warnings) in readWithCursor and
readNextKeyset so the source's StepStats.warningRecords reflects warnings
for cursor- and keyset-based reads (was already correct in read()).
- partitionErrors: requireNonNull(warningsOut) and document the contract.
- Tests: cover the new bare-"not found" exclusion, the "Entity not found:"
inclusion, the readWithCursor stats propagation, and the null-warningsOut
guard.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Show warn for failing test case resolution
* Always recreate
* review: rename matcher + record reader failures before early-return
Address two Copilot comments on PR open-metadata#27800:
1. PartitionWorker.processBatch was returning early when readSuccessCount==0
without invoking failureRecorder.recordReaderEntityFailure for the per-row
errors in that batch — losing entity-level failure diagnostics for
"all-error" batches. Extract the failure-recording into a helper and call
it before the early-return so it runs whether or not the batch contained
any successful rows.
2. Rename ReindexingUtil.isEntityNotFoundError -> isStaleReferenceError to
reflect that the matcher now also catches the relationship-not-found
message ("does not have expected relationship ...") raised by
EntityRepository.ensureSingleRelationship, not just plain entity-not-found.
Update PaginatedEntitiesSource and ReindexingUtilStaleRelationshipTest
call sites. EntityRepository has its own private isEntityNotFoundError
helper that is unrelated and unchanged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix: import java.util.Objects instead of fully qualified name in ReindexingUtil
Agent-Logs-Url: https://github.com/open-metadata/OpenMetadata/sessions/e6d9ce67-1181-4e61-80f4-e7aba664dfe7
Co-authored-by: mohityadav766 <105265192+mohityadav766@users.noreply.github.com>
* Fill End time
* Not * reads
* Fix Fields issue
* Add tags back
* Fix failing test
* Revert "Always recreate"
This reverts commit 23578b0.
* review: cover all EntityNotFoundException formats; quiet null-id WARN
Address two review concerns on PR open-metadata#27800:
1. The stale-reference matcher missed EntityNotFoundException's primary
factory messages — byId ("Entity with id [...] not found."), byName
("Entity with name [...] not found."), byVersion ("Entity with id
[...] and version [...] not found."), and byParserSchema ("Parser
schema not found ..."). These would have been classified as real
failures instead of warnings. Add specific contains() patterns
("entity with id", "entity with name", "parser schema not found")
that match each factory's exact prefix without reintroducing the
over-broad bare "not found" check. byFilter ("Entity not found for
query params [...]") was already covered by "entity not found".
2. PartitionWorker.recordReaderFailures emitted WARN per error when
entityId was null. EntityTimeSeriesRepository builds EntityError
with only a message (no entity reference), so every time-series
error hit that branch — log spam under load. Downgrade to DEBUG
with a comment explaining why the id is absent.
Tests: ReindexingUtilStaleRelationshipTest now exercises every
EntityNotFoundException factory message.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* review: NPE guard, locale-stable matcher, less log spam, accurate Javadoc
Address remaining Copilot comments on PR open-metadata#27800:
1. EntityTimeSeriesRepository.getResultList(...) returns ResultList with
errors=null on the success path. PaginatedEntityTimeSeriesSource was
reading result.getErrors().size() / .isEmpty() right after, which would
NPE on the common no-error path. Normalize errors to an empty list
inside filterStaleRelationshipErrors so callers can rely on non-null.
2. ReindexingUtil.isStaleReferenceError now lowercases with Locale.ROOT
instead of the platform default — avoids Turkish-locale style edge
cases where 'I' lowercases differently and substring matches fail.
3. PaginatedEntityTimeSeriesSource.read() was logging every real reader
error message at WARN. For large failed batches this floods logs.
Switch to a single WARN with the error count plus the first 5 message
details at DEBUG (gated by isDebugEnabled).
4. OmAppJobListener.fillTerminalTimings Javadoc claimed "does nothing if
endTime is already set" but the body still backfills executionTime in
that case. Rewrite to accurately describe the per-field idempotency.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Relaign Changes
* Add Exception handling
* fix(reindex): degrade to required-set, not '*', when filter step throws
ReindexingUtil.getSearchIndexFields was catching every exception in the
filter path and returning ["*"]. That defeats the entire point of
selective fields — sending all fields silently masks any drift between
SearchIndex.COMMON_REINDEX_FIELDS and the entity's schema, instead of
surfacing it at the PaginatedEntitiesSource boundary.
Split the try/catch so:
- getReindexFieldsFor() throwing → ["*"] (we have no required set to
fall back to; pre-selective behavior).
- getOnlySupportedFields() throwing (typically because the
EntityRepository isn't registered yet — boot/test scenarios) → return
the unfiltered required set. PaginatedEntitiesSource validates the
fields when an actual entity flows through, so any real drift surfaces
loudly rather than being silently swallowed by a "*" wildcard.
Restores the assertion and intent of
ReindexingUtilTest.unregisteredRepositoryReturnsRequiredUnfiltered, and
fixes the parametrized parity tests that were also seeing "*" because of
this regression. Also stubs repo.getOnlySupportedFields(...) in the test
mocks so it returns a real EntityUtil.Fields built against the declared
allowedFields — matches the production code path.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Add Only Supported field at other call sites
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>1 parent f43d762 commit 2acf52f
19 files changed
Lines changed: 680 additions & 117 deletions
File tree
- openmetadata-service/src
- main/java/org/openmetadata/service
- apps
- bundles/searchIndex
- distributed
- listeners
- scheduler
- jdbi3
- search/indexes
- util
- workflows/searchIndex
- test/java/org/openmetadata/service
- apps/bundles/searchIndex
- search
- workflows/searchIndex
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
563 | 563 | | |
564 | 564 | | |
565 | 565 | | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
566 | 571 | | |
567 | 572 | | |
568 | 573 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
112 | | - | |
| 113 | + | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| |||
368 | 369 | | |
369 | 370 | | |
370 | 371 | | |
| 372 | + | |
371 | 373 | | |
372 | 374 | | |
373 | 375 | | |
| |||
383 | 385 | | |
384 | 386 | | |
385 | 387 | | |
| 388 | + | |
386 | 389 | | |
387 | 390 | | |
388 | 391 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
562 | 563 | | |
563 | 564 | | |
564 | 565 | | |
| 566 | + | |
565 | 567 | | |
566 | 568 | | |
567 | 569 | | |
| |||
Lines changed: 58 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
518 | 519 | | |
519 | 520 | | |
520 | 521 | | |
| |||
523 | 524 | | |
524 | 525 | | |
525 | 526 | | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
548 | 537 | | |
549 | 538 | | |
550 | 539 | | |
| |||
572 | 561 | | |
573 | 562 | | |
574 | 563 | | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
575 | 602 | | |
576 | 603 | | |
577 | 604 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
228 | 229 | | |
229 | 230 | | |
230 | 231 | | |
| 232 | + | |
231 | 233 | | |
232 | 234 | | |
233 | 235 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
468 | | - | |
| 468 | + | |
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
| |||
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
50 | 89 | | |
51 | 90 | | |
52 | 91 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6607 | 6607 | | |
6608 | 6608 | | |
6609 | 6609 | | |
| 6610 | + | |
| 6611 | + | |
| 6612 | + | |
| 6613 | + | |
| 6614 | + | |
| 6615 | + | |
| 6616 | + | |
6610 | 6617 | | |
6611 | 6618 | | |
6612 | 6619 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| |||
0 commit comments