Skip to content

[WIP] TRT-2811: Make prow loader batch writes resilient to single-batch failures#3798

Draft
mstaeble wants to merge 1 commit into
openshift:mainfrom
mstaeble:worktree-TRT-2811+batch-resilience-synthetic-key-fix
Draft

[WIP] TRT-2811: Make prow loader batch writes resilient to single-batch failures#3798
mstaeble wants to merge 1 commit into
openshift:mainfrom
mstaeble:worktree-TRT-2811+batch-resilience-synthetic-key-fix

Conversation

@mstaeble

@mstaeble mstaeble commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • When a batch write fails in accumulateAndWriteJobRuns, log the error and continue processing subsequent batches instead of aborting the entire load
  • Each batch error is appended individually to pl.errors so LoaderWithMetrics counts them separately in Prometheus metrics
  • A ctx.Err() check at the top of each loop iteration exits cleanly on cancellation to avoid doomed write attempts
  • Removed cancelFetch() call since loadDailyTestAnalysisByJob sources from BigQuery and doesn't depend on PG writes

Test plan

  • go vet ./pkg/dataloader/prowloader/... passes
  • go test ./pkg/dataloader/prowloader/... passes
  • make lint passes
  • Monitor loader logs in staging/prod for batch write errors; confirm subsequent batches continue processing after a failure
  • Verify error count metric reflects individual batch failures (not collapsed into 1)

@coderabbitai ignore

🤖 Generated with Claude Code

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 21, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 21, 2026

Copy link
Copy Markdown

@mstaeble: This pull request references TRT-2811 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

  • When a batch write fails in accumulateAndWriteJobRuns, log the error and continue processing subsequent batches instead of aborting the entire load
  • Each batch error is appended individually to pl.errors so LoaderWithMetrics counts them separately in Prometheus metrics
  • A ctx.Err() check at the top of each loop iteration exits cleanly on cancellation to avoid doomed write attempts
  • Removed cancelFetch() call since loadDailyTestAnalysisByJob sources from BigQuery and doesn't depend on PG writes

Test plan

  • go vet ./pkg/dataloader/prowloader/... passes
  • go test ./pkg/dataloader/prowloader/... passes
  • make lint passes
  • Monitor loader logs in staging/prod for batch write errors; confirm subsequent batches continue processing after a failure
  • Verify error count metric reflects individual batch failures (not collapsed into 1)

🤖 Generated with Claude Code

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 21, 2026
@openshift-ci

openshift-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 21, 2026
@openshift-ci

openshift-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mstaeble
Once this PR has been reviewed and has the lgtm label, please assign dgoodwin for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@mstaeble, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 90a078fc-6c83-49ed-9a7b-b6ecc9ec4a0b

📥 Commits

Reviewing files that changed from the base of the PR and between de6d177 and 00bdc00.

📒 Files selected for processing (1)
  • pkg/dataloader/prowloader/prow.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mstaeble mstaeble changed the title TRT-2811: Make prow loader batch writes resilient to single-batch failures [WIP] TRT-2811: Make prow loader batch writes resilient to single-batch failures Jul 21, 2026
…lures

When a batch write fails in accumulateAndWriteJobRuns, log the error and
continue processing subsequent batches instead of returning immediately.
Each batch error is appended individually to pl.errors so that
LoaderWithMetrics counts them separately. A ctx.Err() check at the top
of each loop iteration exits cleanly on cancellation to avoid doomed
write attempts. The cancelFetch() call is removed since
loadDailyTestAnalysisByJob sources from BigQuery and doesn't depend on
PG writes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mstaeble
mstaeble force-pushed the worktree-TRT-2811+batch-resilience-synthetic-key-fix branch from 00bdc00 to a101186 Compare July 21, 2026 15:58
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants