Skip to content

fix: stagger collection-bucket copy pipe schedules (CM-XXXX) - #4420

Open
gaspergrom wants to merge 2 commits into
mainfrom
fix/CM-tinybird-copy-pipe-schedule-collision
Open

fix: stagger collection-bucket copy pipe schedules (CM-XXXX)#4420
gaspergrom wants to merge 2 commits into
mainfrom
fix/CM-tinybird-copy-pipe-schedule-collision

Conversation

@gaspergrom

@gaspergrom gaspergrom commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Collection-bucketing's copy pipes were scheduled in the same 1–3 AM UTC hour block as the pre-existing leaderboards_* copy pipes, contending for the same account-level concurrent-copy-job quota (12) — this caused leaderboards_members, leaderboards_commits, leaderboards_forks, and leaderboards_issue_response to get stuck permanently queued, emptying the public contributors leaderboard (insights.linuxfoundation.org/leaderboards/contributors)
  • Revised approach (2nd commit): rather than staggering minutes within the shared hour block, this moves the whole collection-bucket block to a separate, previously near-empty hour span so it no longer competes with leaderboards_* for the quota at all:
    • activityRelations_collection_bucket_clean_enrich_copy_pipe_0..9: 1 AM → 4 AM
    • collection_insights_aggregate_copy_pipe_0..9: 2 AM → 5 AM
    • collection_insights_aggregate_projects_copy_pipe: 3 AM → 6 AM
  • Verified zero minute-for-minute collisions across all leaderboards_* + collection-bucket pipes, and that the one pre-existing pipe in the 4–6 AM window (contributions_with_local_time at 4:44) doesn't collide with the new grid
  • No leaderboards_* files touched

Deploy note: the first commit's minute-offset values for the 10 clean_enrich_copy_pipe_* pipes were already pushed to production before this correction landed. Deploying the current commit moves them again (1 AM → 4 AM). The four originally-stuck pipes were already manually retriggered to ok earlier as an immediate fix.

Test plan

  • Verified with .pipe file diffs that no two pipes among the 26 in the 1–6 AM window share the same hour+minute after this change
  • Confirmed no docs/config reference the old schedule literals outside the .pipe files themselves
  • After deploy, confirm monitoring_copy_pipe_executions shows all 26 pipes reaching ok (not queued) on the next scheduled run
  • Confirm leaderboards endpoint (leaderboardType=contributors) continues returning data the day after deploy

…rd collision (CM-XXXX)

Collection-bucketing's clean_enrich and aggregate copy pipes were scheduled
on the same 5-minute grid as the pre-existing leaderboards_* copy pipes,
causing exact minute-for-minute collisions across the 1-3 AM window
(e.g. leaderboards_commits and clean_enrich_copy_pipe_4 both at 1:20 AM).
Under the account's concurrent-copy-job quota this caused leaderboards_members,
leaderboards_commits, leaderboards_forks, and leaderboards_issue_response to
get stuck permanently queued, leaving the contributors leaderboard empty.

Shifts clean_enrich shards by +2 min and aggregate shards (+ aggregate_projects)
by -2/+3 min so no two pipes in the 1-3 AM window share a start minute.
No leaderboards_* files changed.

Signed-off-by: Gašper Grom <[email protected]>
Copilot AI review requested due to automatic review settings July 31, 2026 18:57
@cursor

cursor Bot commented Jul 31, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Schedule-only change, but it shifts when collection insights and cleaned bucket data refresh; post-deploy monitoring should confirm jobs finish ok and downstream timing (aggregate after enrich) still holds.

Overview
Reschedules 21 Tinybird collection-bucket copy pipes so their daily runs no longer share the same UTC minutes as existing leaderboards_* jobs in the 1–3 AM window, which had been exhausting the concurrent copy quota and leaving leaderboard pipes stuck queued.

The ten activityRelations_collection_bucket_clean_enrich_copy_pipe_* jobs move from 01:xx to 04:xx UTC (same 5-minute stagger). The ten collection_insights_aggregate_copy_pipe_* jobs move from 02:xx to 05:xx, and collection_insights_aggregate_projects_copy_pipe moves from 03:00 to 06:00. Only COPY_SCHEDULE lines change; pipe SQL and targets are untouched, and no leaderboards_* files are modified.

Reviewed by Cursor Bugbot for commit c56eadc. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

Copilot AI 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.

🟡 Not ready to approve

Four new schedules still collide with other hourly copy jobs, leaving account-level contention unresolved.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

Staggers collection-bucketing copy jobs to reduce Tinybird scheduling contention.

Changes:

  • Shifts ten clean/enrich shards by two minutes.
  • Shifts aggregate shards and project aggregation.
  • Note: replace the CM-XXXX title placeholder with a valid JIRA key.
File summaries
File Description
collection_insights_aggregate_projects_copy_pipe.pipe Reschedules project aggregation.
collection_insights_aggregate_copy_pipe_0.pipe Reschedules aggregate shard 0.
collection_insights_aggregate_copy_pipe_1.pipe Reschedules aggregate shard 1.
collection_insights_aggregate_copy_pipe_2.pipe Reschedules aggregate shard 2.
collection_insights_aggregate_copy_pipe_3.pipe Reschedules aggregate shard 3.
collection_insights_aggregate_copy_pipe_4.pipe Reschedules aggregate shard 4.
collection_insights_aggregate_copy_pipe_5.pipe Reschedules aggregate shard 5.
collection_insights_aggregate_copy_pipe_6.pipe Reschedules aggregate shard 6.
collection_insights_aggregate_copy_pipe_7.pipe Reschedules aggregate shard 7.
collection_insights_aggregate_copy_pipe_8.pipe Reschedules aggregate shard 8.
collection_insights_aggregate_copy_pipe_9.pipe Reschedules aggregate shard 9.
activityRelations_collection_bucket_clean_enrich_copy_pipe_0.pipe Reschedules clean/enrich shard 0.
activityRelations_collection_bucket_clean_enrich_copy_pipe_1.pipe Reschedules clean/enrich shard 1.
activityRelations_collection_bucket_clean_enrich_copy_pipe_2.pipe Reschedules clean/enrich shard 2.
activityRelations_collection_bucket_clean_enrich_copy_pipe_3.pipe Reschedules clean/enrich shard 3.
activityRelations_collection_bucket_clean_enrich_copy_pipe_4.pipe Reschedules clean/enrich shard 4.
activityRelations_collection_bucket_clean_enrich_copy_pipe_5.pipe Reschedules clean/enrich shard 5.
activityRelations_collection_bucket_clean_enrich_copy_pipe_6.pipe Reschedules clean/enrich shard 6.
activityRelations_collection_bucket_clean_enrich_copy_pipe_7.pipe Reschedules clean/enrich shard 7.
activityRelations_collection_bucket_clean_enrich_copy_pipe_8.pipe Reschedules clean/enrich shard 8.
activityRelations_collection_bucket_clean_enrich_copy_pipe_9.pipe Reschedules clean/enrich shard 9.
Review details
  • Files reviewed: 21/21 changed files
  • Comments generated: 4
  • Review effort level: Balanced

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

TARGET_DATASOURCE collection_insights_aggregate_consolidated_ds
COPY_MODE append
COPY_SCHEDULE 5 2 * * *
COPY_SCHEDULE 3 2 * * *
TARGET_DATASOURCE activityRelations_collection_deduplicated_cleaned_bucket_4_ds
COPY_MODE replace
COPY_SCHEDULE 20 1 * * *
COPY_SCHEDULE 22 1 * * *
TARGET_DATASOURCE collection_insights_aggregate_projects_ds
COPY_MODE replace
COPY_SCHEDULE 0 3 * * *
COPY_SCHEDULE 3 3 * * *
TARGET_DATASOURCE collection_insights_aggregate_consolidated_ds
COPY_MODE append
COPY_SCHEDULE 20 2 * * *
COPY_SCHEDULE 18 2 * * *
…eaderboards (CM-XXXX)

The previous commit staggered minutes within the same 1-3 AM hour block the
leaderboards_* copy pipes already use, but both groups still contended for
the same account-level concurrent-copy-job quota (12) in that shared window.

Move the whole collection-bucket block to a later, previously near-empty
span so it no longer overlaps leaderboards_* at all:
- activityRelations_collection_bucket_clean_enrich_copy_pipe_0..9: 1 AM -> 4 AM
  (restored original :00,:05,...:45 grid)
- collection_insights_aggregate_copy_pipe_0..9: 2 AM -> 5 AM
  (restored original :05,:10,...:50 grid)
- collection_insights_aggregate_projects_copy_pipe: 3 AM -> 6 AM

Verified zero minute-for-minute collisions across all leaderboards_* and
collection-bucket pipes with this layout, and confirmed the only pre-existing
pipe in the 4-6 AM window (contributions_with_local_time at 4:44) doesn't
collide with the new clean_enrich :00-:45 grid.

Note: the 10 clean_enrich_copy_pipe_* files were already pushed to production
with the previous commit's minute-offset values (1 AM range) before this
correction landed; deploying this commit moves them again, to 4 AM.

Signed-off-by: Gašper Grom <[email protected]>
Copilot AI review requested due to automatic review settings July 31, 2026 19:07

@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 and found 1 potential issue.

Fix All in Cursor

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

Reviewed by Cursor Bugbot for commit c56eadc. Configure here.

TARGET_DATASOURCE activityRelations_collection_deduplicated_cleaned_bucket_0_ds
COPY_MODE replace
COPY_SCHEDULE 0 1 * * *
COPY_SCHEDULE 0 4 * * *

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Schedules shifted hours, not minutes

Medium Severity

COPY_SCHEDULE values move the hour by +3 (1→4, 2→5, 3→6) while keeping the same minutes. The intended fix was a minute-level stagger inside the 1–3 AM window (+2 / −2/+3 minutes) so all 26 pipes keep unique start minutes there. Tinybird cron is minute hour ..., so these edits change the wrong field relative to that plan, delay collection refreshes by three hours, and leave the stated 1–3 AM uniqueness check unverified for the new 4–6 AM window. Pipe DESCRIPTION text still documents the old 01:00 / 2:05 / 3:00 times.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c56eadc. Configure here.

Copilot AI 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.

🟡 Not ready to approve

The title uses CM-XXXX instead of the numeric JIRA key required by CI.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Review details
  • Files reviewed: 21/21 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants