Repository navigation
Restore missing Data Insights snapshots when version history is exhausted - #36245
Conversation
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
| if (oldestVersion != null) { | ||
| appendCreationWindow( | ||
| windows, | ||
| latest, | ||
| new VersionedWindow(oldestVersion, startTs, pointerTimestamp, oldestShape)); | ||
| } |
There was a problem hiding this comment.
⚠️ Quality: Snapshot backfill rule from creation day has no decision record
This PR changes which days an entity shows up in Data Insights snapshots, and docs/decisions/ has no record for it. The rule is only in the PR description, and the repo squash-merges, so the description never reaches the tree. The description says: "fills uncovered days with the oldest available version, bounded by the requested window and the entity's createdAt" and "Genuinely new entities keep today-only coverage". The skip for legacy rows without createdAt (appendCreationWindow returns early) shows up only as a test name. The code comment at line 140 explains why the window is extended. It does not say that createdAt is the trusted lower bound, or that entities without it are deliberately left without backdated snapshots.
The record would assert: "When an entity's version history ends inside the Data Insights window, the oldest version covers the remaining days, starting no earlier than the UTC start-of-day of the entity's createdAt. Entities without createdAt are never backdated before their oldest version's updatedAt day."
Add a decision record stating the rule, and cite it from the resolver:
// ADR:2026-10-xx-data-insights-snapshots-extend-oldest-version-to-creation-day
private void appendCreationWindow(
Was this helpful? React with 👍 / 👎
| public record Backfill(String startDate, String endDate) { | ||
| public Backfill { | ||
| if (startDate == null || startDate.isBlank() || endDate == null || endDate.isBlank()) { | ||
| throw new IllegalArgumentException("Backfill requires both startDate and endDate"); | ||
| } | ||
| if (TimestampUtils.getTimestampFromDateString(startDate) | ||
| > TimestampUtils.getTimestampFromDateString(endDate)) { | ||
| throw new IllegalArgumentException("Backfill startDate must not be after endDate"); | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
This check runs in init(), and init() runs on every path, not just on-demand runs. That includes the nightly scheduled run (AbstractNativeApplication.execute() calls init() before startApp()), plus configure, uninstall and app registration at server startup.
So a saved config with backfillConfiguration.enabled: true and a missing date now makes every scheduled run throw in init(). That happens before startApp() reaches the line that drops the backfill for non-on-demand runs (backfill = Optional.empty()). Before this change, that config only broke manual runs, and the nightly job kept working. The Configuration form lets you save it, because neither date is required in the schema.
Because the throw happens outside startApp(), the failed run also skips the catch/finally that marks the job as FAILED and sends the status update.
A possible fix would be to keep init() lenient and build the Backfill only for on-demand runs, inside the try in startApp(). A bad date then fails that run with your clear message, and scheduled runs ignore it:
private Optional<BackfillConfiguration> backfillConfiguration = Optional.empty();In init(), replacing the "Configure Backfill" block:
backfill = Optional.empty();
backfillConfiguration =
Optional.ofNullable(config.getBackfillConfiguration())
.filter(backfillConfig -> Boolean.TRUE.equals(backfillConfig.getEnabled()));In startApp(), replacing the if (!runType.equals(ON_DEMAND_JOB)) block:
boolean onDemand = runType.equals(ON_DEMAND_JOB);
backfill =
onDemand
? backfillConfiguration.map(
backfillConfig ->
new Backfill(backfillConfig.getStartDate(), backfillConfig.getEndDate()))
: Optional.empty();
if (!onDemand) {
recreateDataAssetsIndex = Optional.empty();
}It might also be worth adding a test for a scheduled run with enabled: true and no dates, to confirm it still completes.
| if (!(latest instanceof CreationAudited audited) || audited.getCreatedAt() == null) { | ||
| return; | ||
| } | ||
| // Non-versioned updates can move even the oldest version's updatedAt past its creation day. |
There was a problem hiding this comment.
Non-blocking, just to get the scope right. The same root cause also hits entities with more than one version, and this fix doesn't reach them because their history isn't exhausted.
Example: a table got a description in v0.2 ten days ago, and its lifeCycle changes every night.
- Tonight's ingestion moves v0.2's
updatedAtto today. - The resolver gives today to v0.2, then gives yesterday to v0.1, the version without the description.
- Yesterday is rewritten on every run, so each day's final snapshot is written after the next night's touch. Every finished day ends up showing the previous version.
Counts are right, so it's invisible in "Total Data Assets". But description, owner and tier coverage stay one version behind for tables whose lifeCycle changes daily.
The cause is upstream of Data Insights. updatedAt is documented as "Last update time corresponding to the new version of the entity", but the store paths move it on changes that don't bump the version. That's tracked separately in #36248, not in this PR. Your createdAt fallback stays useful there for data written before such a fix.
For now, it might be worth narrowing the title and description to what this PR fixes: entities with a single version dropping out of earlier days after a lifeCycle-only update.
Code Review
|
| Compact |
|
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source
🚦 Removed from the merge queue —
|
🚦 Removed from the merge queue —
|
Adapt PR #36245 (05c972f and 4afb297) to the release branch. Use retained activity-stream creation events to bound uncovered snapshot days because 2.0 has no creation-audit field. Preserve missing-evidence behavior and validate backfill dates only inside manual run handling. Cover creation boundaries, lifecycle-only bulk updates, creation-event filtering, and scheduled/manual backfill execution.
Describe your changes
No linked issue for now.
Data Insights rewrites yesterday and today on every normal run. A lifecycle-only update can advance
updatedAtwhile leaving an old entity at v0.1, causing version-history exhaustion to omit yesterday's snapshot.Use the entity's OpenMetadata
createdAtto fill uncovered days with the oldest available version, bounded by the requested window and creation day. Preserve today's-only coverage for genuinely new entities.This fills uncovered days only when version history is exhausted. Wrong-version attribution when an older version already covers a day remains separate: #36248.
Keep backfill configuration raw during app initialization. Validate enabled backfill only for manual runs, inside the run's error handler, so invalid dates produce a reported failed run. Scheduled runs ignore backfill settings, including incomplete dates.
Historical backfill still requires trustworthy creation dates. Existing legacy rows whose
createdAtis absent or was derived from an already-advancedupdatedAtneed historical evidence before those dates can be repaired.Type of change
High-level design
N/A — scoped backend bug fix using existing creation-audit fields; no schema, migration, or API shape changes.
Tests
Unit tests rerun for
4afb297124c3897ade687995a55216f47f1ff1d1: 47 passed acrossDataAssetTypeCoverageTest,DataInsightsAppTest,DataInsightsBackfillTest,DataInsightsEntityEnricherProcessorTest,VersionResolverTest. Initial-fix coverage at05c972f2d0c76b346d455740c85cf8664fd2d60b: resolver 98.3%; backfill validation 100%. Temporarily disabling the initial fixes produced the expected missing-day and missing-date assertion failures, then the fixes were restored.Integration regression coverage was added to
DataInsightsEnricherBehaviorIT:updatedAt, preserves v0.1 and a one-version history, and emits yesterday and today.Both initial snapshot integration cases passed on real MySQL/Elasticsearch.
The follow-up at
4afb297124c3897ade687995a55216f47f1ff1d1reranAppsResourceITon MySQL/Elasticsearch: 40 tests, 34 passed, 6 existing skips, 0 failures or errors. All four new backfill cases executed and passed:FAILEDwith the configuration error.mvn spotless:apply,spotless:check, the Java impact-map check,git diff --check, and commit hooks passed for the follow-up.Initial validation at
05c972f2d0c76b346d455740c85cf8664fd2d60b: broad run failed; focused retries passed.The results below apply to the initial fix. The follow-up unit and app-integration results are recorded above; the broad run was not repeated after the validation-timing change.
The broad run timed out in
GlossaryTermResourceIT#get_assetsCountsWithParentFilterand#get_assetsCountsWithNoParent. Both methods passed in the isolated run with the original assertions and timeouts. The broad run was not repeated.Integration classes selected and executed
AppMarketPlaceResourceIT,AppOperationPermissionsIT,AppRunInterruptionIT,AppTriggerConflictIT,AppsResourceIT,BundleWarmupCertificationIT,ConfigResourceIT,CsvAsyncJobResourceIT,DataContractValidationAppIT,DataInsightAggregationIT,DataInsightAliasReconciliationIT,DataInsightChartResourceIT,DataInsightSystemChartResourceIT,DataInsightsEnricherBehaviorIT,DataRetentionAppIT,DatabaseSmokeIT,EnricherBulkVsHistoryPathEquivalenceIT,GlossaryTermResourceIT,IndependentOntologyRetentionIT,K8sOMJobOperatorIT,KpiResourceIT,ReportDataResourceIT,SeedDataPresenceIT,SoftDeleteRetentionIT,SystemAlertsIT,SystemResourceIT,TableResourceIT,TestCaseRelationshipRetentionCleanupIT,UserResourceIT,WebAnalyticEventResourceITThe isolated run included
AppsResourceIT,DataContractValidationAppIT,SystemResourceIT, and the two focusedGlossaryTermResourceITretries. The cache run executedBundleWarmupCertificationITwith PostgreSQL, Elasticsearch, and Redis.Ingestion and Playwright: N/A — no ingestion or UI changes.
Manual UI testing: not performed. The API/bulk-update scenarios above were exercised by integration tests.
UI screen recording
N/A — backend-only bug fix.
Checklist
REVIEW.md, including follow-up4afb297124c3897ade687995a55216f47f1ff1d1; initialization no longer validates backfill and scheduled/manual behavior has regression coverage.

Confidence Score: 5/5
The PR appears safe to merge; no actionable new issues were found.Summary
Restores missing Data Insights snapshots after version history runs out, using
createdAtto bound the oldest available version.No actionable new issues were found in the changes since the previous review.
Reviews (2) · Last reviewed commit: "Validate Data Insights backfill only for..." · Reviewed by Greptile