Repository navigation
alerting: bound infra scan queries so they fit the statement timeout - #137
Merged
Merged
Conversation
The infra scan never completed a single run at production data scale: gpu_temperatures and the gpu side of latest_reports run unbounded DISTINCT ON over gpu_snapshots (8.5M rows), and gpu_temperatures exceeds the 2-minute statement timeout every scan. - gpu_temperatures: only readings from the last 2 days count. Stale readings should not sustain a temperature breach anyway — a host that stops reporting is the unreporting alert's job. - latest_reports (gpu side): bound at 14 days, twice the 7-day retirement age, so retirement aging still sees the last reports it needs while skipping the rest of history. Signed-off-by: Thang Nguyen <thang.nguyen@inferact.ai>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The infra scan (restored today) has never completed a run: after fixing the Buildkite
read_agentsscope, every scan fails withcanceling statement due to statement timeout.Measured on the worker against production data:
gpu_snapshotssizestatement_timeoutlatest_reportsgpu_temperaturesRoot cause: unbounded
DISTINCT ONover all ofgpu_snapshotshistory.Fix
gpu_temperatures: only readings from the last 2 days count. This is also semantically right —_plan_gpu_temperaturehas no staleness check, so a dead host's last hot reading would otherwise sustain a temperature breach forever; a silent host is the unreporting alert's job.latest_reports(gpu CTE): bounded at 14 days = 2× the 7-dayRETIREMENT_AGE, so retirement aging still sees every last-report it needs while skipping the rest of history.Tests
pytest alerting199 passed, ruff clean, mypy shows only the pre-existing local-venv boto3 stub errors (identical without this change). The fake-connection infra tests match on the queries'SELECT DISTINCT ONprefix, which is unchanged.Deploy
Worker picks this up on the next
install.shfrommain; after that the 5-minute infra scan should go green and we can flipcontrol/infra.modetolive.Signed-off-by: Thang Nguyen thang.nguyen@inferact.ai