Skip to content

[2.0] Restore Data Insights snapshots after version-history exhaustion - #36273

Merged
IceS2 merged 1 commit into
2.0from
backport/2.0/pr-36245
Oct 27, 2026
Merged

IceS2 merged 1 commit into
2.0from
backport/2.0/pr-36245

Conversation

@IceS2

@IceS2 IceS2 commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Describe your changes

Adapted backport of #36245 to 2.0, including its scheduled-run regression correction. The source PR is still open. No separate issue is linked, as requested.

When lifecycle-only ingestion advances updatedAt without a version bump, Data Insights can exhaust version history inside its rewrite window and omit earlier days. Fill those uncovered days with the oldest available version, bounded by creation evidence and the requested window.

Type of change

  • Bug fix

High-level design

2.0 has neither the createdAt schema field nor the CreationAudited interface used on main. This port reads the earliest retained EntityCreated event from activity_stream, using its existing (entityType, entityId, timestamp) index. It queries only after history exhaustion leaves uncovered days. There are no schema or migration changes.

The fallback starts at the later of the requested start day and the creation-event day. If no creation event remains, it preserves the existing windows. It does not infer creation from updatedAt or source-system lifecycle timestamps.

Limitation: assets created before activity-stream recording was enabled, or whose creation events have expired, cannot be repaired by this fallback. It also leaves wrong-version attribution when older history already covers a day outside scope; that is tracked in #36248.

Backfill dates are validated only during enabled manual runs, inside the run error handler. Scheduled runs and app initialization ignore incomplete backfill settings.

Sources: commits 05c972f2d0 and 4afb297124 from #36245. Reviewed backport commit: 1a51fb88ee4365e6938ed00665ae6792b3256fd2.

Tests

Local validation: PASSED for the scopes below.

Scope Tests/checks Passed Failures/errors Skipped
Focused Java unit tests 45 45 0 0
MySQL + Elasticsearch, isolated execution 63 57 0 6
PostgreSQL 16, actual DAO checks 5 5 0 0

Unit classes: DataAssetTypeCoverageTest (4), DataInsightsAppTest (3), DataInsightsBackfillTest (8), DataInsightsEntityEnricherProcessorTest (18), VersionResolverTest (12).

Measured unit line coverage: VersionResolver 63/69 lines (91.3%); DataInsightsApp.Backfill 7/7 lines (100%).

MySQL integration classes: AppsResourceIT (40 tests, 6 skips), DataInsightsEnricherBehaviorIT (11), EnricherBulkVsHistoryPathEquivalenceIT (12). All eight new regression cases executed without skips:

  • Lifecycle-only bulk update preserves v0.1 and one version, and emits yesterday and today when a creation event exists.
  • An entity created today has no earlier snapshot.
  • Missing historical creation evidence adds no earlier snapshot.
  • Creation lookup excludes update events and other entity IDs/types.
  • Scheduled execution ignores enabled backfill with missing dates.
  • Manual execution reports missing dates as a failed run with a configuration error.
  • Manual execution accepts valid backfill dates.
  • Manual execution ignores disabled backfill with missing dates.

The PostgreSQL check invoked the committed CollectionDAO.ActivityStreamDAO through Jdbi against a temporary PostgreSQL 16 database. Five assertions checked earliest creation, update-event exclusion, entity ID/type isolation, and absent-event null results. The full PostgreSQL/OpenSearch application lane was not run.

The first MySQL attempt was aborted because stale main-branch app-definition resources prevented app initialization. All backend reactor outputs were then cleaned, and the unit and MySQL integration scopes above passed from clean outputs.

spotless:apply, spotless:check, git diff --check, and commit hooks passed. The Java affected-test planner and impact map do not exist on 2.0; the scoped classes above were selected from the changed behavior and its callers.

Ingestion, UI/Playwright, and UI recording: not applicable. Manual UI testing was not performed; the behavior was exercised by the integration checks above.

Checklist

  • Self-reviewed commit 1a51fb88ee4365e6938ed00665ae6792b3256fd2; each changed source has behavioral coverage, with no unanswered blocking findings.
  • Backport adaptations and creation-event retention limits are disclosed.
  • Regression cases and exact validation scope are recorded above.
  • No schemas, migrations, ingestion code, or UI changed.

Draft while source PR #36245 remains open and the release-specific creation-evidence adaptation is reviewed.

RetriggerView in GreptileConfidence Score: 4/5

No blocking behavior defect was established, but the explicit repository style requirements must be satisfied before merging.

Findings

  1. P2 Early exits break the guide ▶
  2. P2 Unchanged values lack `final` ▶
  3. P2 Assertion breaks the string rule ▶

Summary

Restores uncovered Data Insights days after version history runs out.

  • Data Insights fills uncovered days with the oldest retained version.
  • Enabled manual backfills use valid date ranges, while scheduled runs ignore them.

IceS2 acknowledges the missing-creation-event limitation and defers existing wrong-version attribution for already-covered days to #36248.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Walk version history] --> B{History exhausted?}
  B -->|No| C[Keep existing version windows]
  B -->|Yes| D{Uncovered days remain?}
  D -->|No| C
  D -->|Yes| E[Read earliest retained creation event]
  E --> F{Creation event found?}
  F -->|No| C
  F -->|Yes| G[Bound start by requested start and creation day]
  G --> H[Add uncovered days using oldest available version]
Loading

Reviews (1) · Last reviewed commit: "Backport Data Insights snapshot repair t..." · Reviewed by Greptile

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.
@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Oct 26, 2026
@gitar-bot

gitar-bot Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Extending Data Insights history with the oldest retained entity version could assign approximate state to uncovered days and alter historical snapshot analytics.

Backports the Data Insights snapshot repair to 2.0, filling uncovered days with the oldest available version bounded by the earliest retained EntityCreated event in activity_stream. No open findings; the change is approved.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@IceS2
IceS2 marked this pull request as ready for review October 27, 2026 05:52
@IceS2
IceS2 requested a review from a team as a code owner October 27, 2026 05:52
@IceS2
IceS2 requested review from pmbrull and removed request for a team October 27, 2026 05:52
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@IceS2
IceS2 enabled auto-merge (squash) October 27, 2026 05:52
Comment on lines +151 to +156
if (remaining.windowStartTimestamp() > remaining.windowEndTimestamp()) {
return;
}
Long createdAt = creationTimeLookup.apply(entityType, id);
if (createdAt == null) {
return;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Early exits break the guide

appendCreationWindow adds two early returns. The repository guide requires one return at the end and explicitly forbids early-return guards. Put the lookup and append steps behind conditions, or extract helpers. This requirement must be satisfied before merging.

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

if (remaining.windowStartTimestamp() > remaining.windowEndTimestamp()) {
return;
}
Long createdAt = creationTimeLookup.apply(entityType, id);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unchanged values lack final

The additions leave unchanged local variables and parameters without final, contrary to the repository guide. Examples include createdAt and start here, and config in runDataInsights. Apply final throughout the additions where values do not change. This requirement must be satisfied before merging.

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

assertEquals(AppRunRecord.Status.FAILED, app.reported.getStatus());
IndexingError failure =
(IndexingError) app.reported.getFailureContext().getAdditionalProperties().get("failure");
assertTrue(failure.getMessage().contains("Backfill requires both startDate and endDate"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Assertion breaks the string rule

The new assertion passes a raw string to contains. The repository guide explicitly forbids raw strings in contains calls. Define a named constant for the expected error text and use it here. This requirement must be satisfied before merging.

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@IceS2
IceS2 merged commit 50ce78b into 2.0 Oct 27, 2026
113 of 117 checks passed
@IceS2
IceS2 deleted the backport/2.0/pr-36245 branch October 27, 2026 08:24

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ingestion 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