Repository navigation
perf: run the issue analysis copy every 3 hours - #5536
Conversation
Each run reads the unfiltered activity buckets (~40 min), and only the issues-resolution widget and API endpoint read issues_analyzed at query time. On the hour, the 00:00 run ends before the bucket merges and the daily readers. Refs linuxfoundation/lfx-cdp-insights-ops#1182 Signed-off-by: Uroš Marolt <uros@marolt.me>
PR SummaryLow Risk Overview In the Pipe DESCRIPTION text is updated to document the schedule rationale, run duration, and that only the issues-resolution widget/API read this table at query time (~3h staleness). Reviewed by Cursor Bugbot for commit 0a207da. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
@themarolt I'm starting review 1 of this pull request now (started 2026-12-06 20:44 UTC using review agent v0.1.37). This usually takes a few minutes. I'll update this comment with the summary when I'm done. If there's no summary here after about 45 minutes, the review stopped: push a new commit, or post a comment that begins with a mention of me followed by Hi Uros Marolt, thanks for the detailed PR description and the production checks behind it. SummaryThis change moves Decision✅ Approved The required DetailsOverall impression: This is a one-file Tinybird pipe change: a schedule change, a type cast, and description text. The Other reviewers and CI checks: Cursor Bugbot posted a summary comment with no findings, and it agrees with this review. The only required check, Documentation reminder: changed Rule files: read Questions, problems, or feedback: https://github.com/linuxfoundation/lfx-review-agent/issues |
There was a problem hiding this comment.
🔵 Needs a closer look
The previously undeployed full-workspace copy has only single-segment timing data, so full-scale runtime and worker contention need human validation to confirm it finishes before nightly consumers run.
No open issues 🎉
What changed in this PR
Reduces Tinybird issue-analysis copy frequency to lower daily processing load while supporting CDP’s issue metrics.
Changes:
- Runs the copy every three hours, on the hour, instead of hourly at :20.
- Preserves the destination’s
LowCardinality(String)type forplatform. - Documents scheduling rationale and query-time consumers.
| File | Description |
|---|---|
services/libs/tinybird/pipes/issue_analysis_copy_pipe.pipe |
Updates the copy schedule, platform type conversion, and freshness documentation. |
Review effort: Balanced
lfx-one
left a comment
There was a problem hiding this comment.
No blocking or minor findings. The schedule change and the toLowCardinality cast are consistent with the pipe's target schema, and the pipe description now explains the new cadence.
Documentation
This pull request changes behavior that may also be described outside this repository, such as product pages or an external docs site. I can't read those, so please check them; the author and maintainers own those updates. Changed here:
COPY_SCHEDULE(changed from20 * * * *to0 */3 * * *, so query-time issue metrics can be up to about 3 hours old)
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge. SummaryRuns
Intentional trade-off: themarolt acknowledges that the issues-resolution widget and API endpoint will receive less frequent updates. Reviews (1) · Last reviewed commit: "perf: run the issue analysis copy every ..." · Reviewed by Greptile |
Summary
issue_analysis_copy_piperuns every hour. Production still runs a pre-#5028 version (reverted on 2026-11-02 because the #5028 version took ~78 min): it readsactivityRelations_deduplicated_cleaned_bucket_unionthree times per run (median 31 min, 3.3B rows / 303 GiB) and leaves out bot-opened and bot-closed issues. Main's version (#5165: one read of the unfiltered buckets plus the snapshot MV delta) has never been pushed and is expected at ~40 min per run. This runs it every 3 hours so main's version can go out with about a third of today's daily copy load.Changes
COPY_SCHEDULE 0 */3 * * *(was20 * * * *). On the hour, the 00:00 run ends before the 00:40-00:48 bucket merges and beforehealth_score_copy(00:50), so every daily reader ofissues_analyzed(00:50-02:15) gets the 00:00 run; copies starting at :00 waited a median 2 s for a worker over the last 2 days, against 32 s at :20.platformis wrapped intoLowCardinality(...):tupleElementdrops LowCardinality and theissues_analyzedcolumn isLowCardinality(String).Readers: the Insights issues-resolution widget and public API endpoint (
issues_count,issues_average_resolve_velocity) readissues_analyzedat query time and see data up to ~3 h old; the health score, leaderboard and agentic AI copies are daily.Checked read-only on production: every input main's version reads exists with the referenced columns; the whole pipe run for one segment finished in 8 s with 5,319 rows (the current table has 4,994 for that segment; the difference is bot-opened issues), and its output columns match
issues_analyzedin order, names and nullability.Deploy
Tinybird is not deployed on merge:
tb push services/libs/tinybird/pipes/issue_analysis_copy_pipe.pipe --forcefrom an up-to-date checkout, outside a running copy (avoid the hour mark). This ships main's whole version for the first time; the first run rebuildsissues_analyzed(replace) and adds bot-opened and bot-closed issues. Then check the runtime of the first runs intinybird.datasources_ops_log.Type of change
Related issue
Refs linuxfoundation/lfx-cdp-insights-ops#1182