Skip to content

fix(aggregation): drain the raw backlog in one run and log lag - #978

Merged
fclairamb merged 3 commits into
mainfrom
feat/todos-2026-11-22
Nov 22, 2026
Merged

fclairamb merged 3 commits into
mainfrom
feat/todos-2026-11-22

Conversation

@fclairamb

Copy link
Copy Markdown
Owner

Aggregation now drains its backlog in one run instead of rolling up a single (check, region, hour) bucket per job round-trip.

  • A run keeps aggregating, highest-priority stage first, until no work is left, a stage fails, or a budget of 30 s / 1000 buckets is spent. Only a run that hit its budget with work left reschedules immediately; otherwise the next run is in 1 h.
  • When a run hits its budget, or its oldest raw bucket is more than 1 h past the retention boundary, it logs Aggregation is behind its raw retention at INFO (buckets per stage, duration, raw_lag_minutes), so lag is visible before the uptime bar warns.
  • Not included: a Prometheus gauge for the backlog.

Closes fclairamb/solidping-business#104

🤖 Generated with Claude Code

…dping-business#104)

An org with several check x region pairs could see its raw results outlive
the raw retention by hours (uptimebar "aggregation is lagging" warning): each
aggregation run rolled up a single bucket and rescheduled itself at delay=0
(job_aggregation.go Run), so every bucket paid a job-queue round-trip.

Run now loops over the stages until nothing is left, a stage errors, or a
30 s / 1000-bucket budget is spent; only a run stopped on its budget
reschedules at delay=0, a drained one waits +1h as before. A run that stopped
on its budget, or whose oldest raw bucket was more than 1h past the retention
boundary, logs "Aggregation is behind its raw retention" at INFO with the lag.

TestRun_DrainsWholeBacklogInOneRun (5 old buckets, one run) failed before the
fix (1 hour row instead of 5); the cap and lag-logging paths are also tested.

Closes fclairamb/solidping-business#104

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@fclairamb fclairamb added autopilot frozen Batch PR under review: takes only its own fixes, new work goes to the next batch labels Nov 22, 2026
@codecov

codecov Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.30769% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.90%. Comparing base (54f1c65) to head (17125a7).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
server/internal/jobs/jobtypes/job_aggregation.go 92.30% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #978      +/-   ##
==========================================
+ Coverage   90.89%   90.90%   +0.01%     
==========================================
  Files        1405     1405              
  Lines      145346   145394      +48     
==========================================
+ Hits       132114   132174      +60     
+ Misses      13224    13212      -12     
  Partials        8        8              
Files with missing lines Coverage Δ
server/internal/jobs/jobtypes/job_aggregation.go 96.46% <92.30%> (-0.06%) ⬇️

... and 29 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fclairamb
fclairamb merged commit 26b93cd into main Nov 22, 2026
39 checks passed
@fclairamb
fclairamb deleted the feat/todos-2026-11-22 branch November 22, 2026 17:21
fclairamb added a commit that referenced this pull request Nov 22, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.53.0](v0.52.0...v0.53.0)
(2026-11-22)


### Features

* **auth:** OIDC-only mode with IdP group admin roles
([#966](#966))
([1b51f89](1b51f89))
* **service:** install writes config.env, unit loads it via
EnvironmentFile
([#948](#948))
([e4b7fc4](e4b7fc4))


### Bug Fixes

* **aggregation:** drain the raw backlog in one run and log lag
([#978](#978))
([26b93cd](26b93cd))
* **deps:** update github.com/dop251/goja digest to 79d6ad3
([#972](#972))
([02c6821](02c6821))
* **deps:** update go dependencies (non-major)
([#955](#955))
([7dfbcd6](7dfbcd6))
* **deps:** update go dependencies (non-major)
([#968](#968))
([6c09bae](6c09bae))
* **deps:** update go dependencies (non-major)
([#979](#979))
([ee088b6](ee088b6))
* **deps:** update module github.com/oapi-codegen/oapi-codegen/v2 to
v2.9.0 ([#975](#975))
([1121e2e](1121e2e))
* **deps:** update module go.mongodb.org/mongo-driver/v2 to v2.10.1
([#950](#950))
([9e684c4](9e684c4))
* email validation, OAuth error display, translator crash guard, clone
slugs, watchdog pauses
([#959](#959))
([a20f951](a20f951))
* log OAuth code-exchange failures, show a refused sign-in on the
invitation page
([#974](#974))
([c4a8dca](c4a8dca))
* retry SMTP 4xx, 503 on agent auth DB errors, scope checkGroupUid to
the org ([#973](#973))
([88179aa](88179aa))
* **security:** block WebRTC around the browser egress proxy, survive an
invalid status page ?lang=
([#957](#957))
([79bdc82](79bdc82))
* **security:** keep OIDC-group admin grants revocable, mask resolved
channel references, contain browser popups
([#976](#976))
([6e0f09e](6e0f09e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge autopilot frozen Batch PR under review: takes only its own fixes, new work goes to the next batch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant