[server] Fix repeated provider data deletion scans and progress - #1689
Conversation
Repeated deletions paginated tombstoned rows, causing hours of full-projection scans and unchanged progress.
📝 WalkthroughWalkthroughThe provider deletion job now selects latest metric-stream versions before excluding tombstones, tracks examined rows in durable checkpoints, reports richer progress, and adds regression coverage and operational documentation. ChangesProvider deletion processing
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Storybook previews for This comment updates automatically on each PR push. |
|
[Review Note] File: 🛠️ Filter Deleted Rows in TypeScriptFilter out the already-deleted rows in TypeScript before calling |
|
[Review Note] File: 🚨 Critical Performance Issue:
|
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Run the checksum-pinned Gitleaks CLI against local commit ranges so pull-request API outages cannot prevent required secret scanning.
Review SummaryThe changes in this Pull Request are correct, robust, and well-tested. 💡 Note on the Subquery and CorrectnessThe subquery introduced in
The performance is well-optimized since the query utilizes the covering projection LGTM! 🚀 🤖 Reviewed by codereviewbot.ai - Catch bugs before your team does. |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
|
Addressed the remaining PR-level review items.
|
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
Add a live-candidate projection so cursor pages read in order while the covering projection continues to validate latest row state. Existing parts require projection materialization before redrive.
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
ClickHouse 26.3 selects the live-candidate projection but scans the full provider range instead of stopping at LIMIT. Use the same stable 26.6 runtime validated by the deletion regression.
LGTM! 🚀This is an exceptionally well-designed and thoroughly tested Pull Request. Key Highlights:
No issues found. Great job! 🤖 Reviewed by codereviewbot.ai - Catch bugs before your team does. |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
Summary
Repeated provider deletions paginated every historical metric-stream key even when its latest ClickHouse version was already tombstoned, causing hours of full-projection scans and an unchanged UI message.
This change selects the newest
(generation, id)version before filtering deleted rows, records examined-row counts, and publishes live progress rendered by web and mobile.It adds unit and real-ClickHouse regression coverage and updates the deletion runbook and production incident baseline.
Validation: 6 processor unit tests, 4 ClickHouse integration tests, 197 surrounding tests, full lint, and root/server typechecks pass; the broader changed run passed 6,288 tests with four unrelated existing FIT-import integration failures.
Summary by cubic
Fixes repeated provider deletions that rescanned tombstoned metric streams by paging only live candidates and showing clear progress. Adds a live-candidate projection, upgrades ClickHouse to 26.6.1.1193 for bounded reads, and switches secret scans to checksum-pinned local
gitleaks.Bug Fixes
by_provider_live_generation, then validates each key’s latest version withby_provider_generation; skips already-deleted keys and keeps 1,000-key pages under ~16k reads.examinedRowsand report “Checked X metric stream rows; deleted Y...”.Migration
0048_provider_live_generation_projection. Materialize bothby_provider_generationandby_provider_live_generationon existing parts before redriving deletions.Written for commit d255a5e. Summary will update on new commits.
Summary by CodeRabbit
Bug Fixes
Documentation
Tests