Skip to content

feat(system-update): add progress ETA for entity-consistency scans - #19388

Open
david-leifker wants to merge 4 commits into
masterfrom
feat/pfp-5407-entity-consistency-progress
Open

feat(system-update): add progress ETA for entity-consistency scans#19388
david-leifker wants to merge 4 commits into
masterfrom
feat/pfp-5407-entity-consistency-progress

Conversation

@david-leifker

@david-leifker david-leifker commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds reusable ProgressTracker and ConsistencyScanRunner so long-running entity-consistency upgrade scans can report rate and human-readable ETA (~1 INFO line/min after warmup) without per-batch log spam.
  • Wires FixEntityConsistencyStep onto the runner with configurable progressLogIntervalMs / progressWarmupMs.
  • Exposes additive totalEstimate (matching entity/doc count) on OpenAPI consistency check/fix responses for the first page.

Test plan

  • :metadata-io unit tests for ProgressTracker, ConsistencyScanRunner, ConsistencyService
  • :datahub-upgrade FixEntityConsistencyStepTest
  • :metadata-service:openapi-servlet ConsistencyControllerTest
  • Spotless apply on touched modules
  • Local system-update: confirm start + throttled mid-run ETA lines for a multi-minute entity-consistency scan

Made with Cursor


Summary by cubic

Adds ETA-based, throttled progress to entity-consistency scans and exposes a total estimate on first-page OpenAPI responses. Previously we logged per batch without ETA and always marked success; now we log rate and human-readable ETA after warmup, persist silent checkpoints, cap batches to respect limits, and keep IN_PROGRESS with Action.ABORT when a scan is interrupted.

  • Reusable utilities in metadata-io: ProgressTracker, ConsistencyScanRunner, and ConsistencyService.countMatching backed by ESSystemMetadataDAO.count; soft-fails on ES errors, logs failures, caps totals by limit (including zero), and only enables entity ETA when key-aspect-only is true.
  • FixEntityConsistencyStep uses the runner: preserves batch delay/limit, caps batch size to honor limits, stops on interrupt and returns IN_PROGRESS/ABORT, clears per-batch orphan URNs, silently checkpoints scroll/counters/last ETA, and records totalEstimate in the final state.
  • OpenAPI /consistency/check and /consistency/fix include totalEstimate on the first page only; resume pages skip counting.
  • Configuration: progressLogIntervalMs and progressWarmupMs (defaults 60000/30000) via env vars SYSTEM_UPDATE_ENTITY_CONSISTENCY_PROGRESS_LOG_INTERVAL_MS and SYSTEM_UPDATE_ENTITY_CONSISTENCY_PROGRESS_WARMUP_MS. No migrations required.

Written for commit 29e1d20. Summary will update on new commits.

Review in cubic

Introduce reusable ProgressTracker and ConsistencyScanRunner so long
entity-consistency upgrade runs can log rate and ETA without log spam,
and expose additive totalEstimate on OpenAPI consistency responses.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions github-actions Bot added product PR or Issue related to the DataHub UI/UX devops PR or Issue related to DataHub backend & deployment labels Aug 22, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

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.

All reported issues were addressed across 23 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@codecov

codecov Bot commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.10236% with 24 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...em/entityconsistency/FixEntityConsistencyStep.java 80.61% 7 Missing and 12 partials ⚠️
.../operations/consistency/ConsistencyController.java 88.00% 0 Missing and 3 partials ⚠️
...ons/consistency/models/ConsistencyCheckResult.java 50.00% 1 Missing ⚠️
...tions/consistency/models/ConsistencyFixResult.java 50.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@maggiehays maggiehays added the needs-review Label for PRs that need review from a maintainer. label Aug 22, 2026
Correct resume rate/ETA baseline, cap onStart totals with limit, preserve
zero totals, default warmup, narrow countMatching failures, stop scan on
delay interrupt, and clear per-batch orphan state while keeping shared caches.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 23d8b03. Configure here.

@cubic-dev-ai cubic-dev-ai Bot left a comment

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.

All reported issues were addressed across 9 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

…upted

Propagate cancelled state from ConsistencyScanRunner through
FixEntityConsistencyStep so interrupt during batch delay does not mark
entity types or the job SUCCEEDED. Also soft-fail countMatching on ES
errors only and normalize negative ProgressTracker inputs.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

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.

All reported issues were addressed across 9 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Return Action.ABORT on interrupt so DefaultUpgradeManager does not mark
the upgrade SUCCEEDED, cap batch size to honor scan limits exactly, log
countMatching failures with stack traces, and assert cancellation on
the test thread after join.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops PR or Issue related to DataHub backend & deployment needs-review Label for PRs that need review from a maintainer. product PR or Issue related to the DataHub UI/UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants