fix(gold): spillable joins and headroom for deploy-time builds - #1896
Conversation
The git observation build exceeded its 1.5 GiB query cap on a grown instance: the external group-by/sort thresholds spill aggregation and sort state, but hash-join tables spill under neither, so the join-heavy models fail outright once their build outgrows the cap. Set join_algorithm to grace_hash (hash fallback for join shapes grace does not support) so joins partition to disk under pressure, raise the cap to 3 GiB for spill overhead headroom, and apply one uniform settings block to every table-materialized gold model — wiki had shipped with no bounds at all. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Aleksandr Barkhatov <pm@aleks.bar>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe change extends the default Helm timeout and updates ClickHouse gold ingestion models with table materialization and explicit resource, spill, and join execution settings. ChangesDeployment timing
Gold execution tuning
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
The ai model was the one observation view left; every other family is a sorted table. Same materialization, ordering key, and bounded-build settings as its siblings, so runtime queries index-prune instead of re-deriving from silver per request. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Aleksandr Barkhatov <pm@aleks.bar>
The 10m --atomic timeout bounds rollout waits plus the post-upgrade clickhouse-migrate hook. Gold builds now spill to disk under memory pressure — deliberately slower — and dbt's own per-query timeout is 25m, so helm was the binding constraint that would roll back a slow but succeeding build. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Aleksandr Barkhatov <pm@aleks.bar>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@deploy/gitops/Makefile`:
- Around line 57-60: Update the deployment guidance in the GitOps README to
document TIMEOUT ?= 30m, matching the default defined in the Makefile and used
by deploy-insight’s --timeout option. Preserve the surrounding deployment
instructions and examples.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: f3415403-440f-45d2-8905-5a68e89daa6c
📒 Files selected for processing (8)
deploy/gitops/Makefilesrc/ingestion/gold/ai_metric_observations.sqlsrc/ingestion/gold/collab_metric_observations.sqlsrc/ingestion/gold/git_metric_observations.sqlsrc/ingestion/gold/task_issue_state.sqlsrc/ingestion/gold/task_metric_observations.sqlsrc/ingestion/gold/task_status_spans.sqlsrc/ingestion/gold/wiki_metric_observations.sql
| # Covers rollout waits plus the post-upgrade clickhouse-migrate hook; the | ||
| # gold build inside that hook spills to disk under memory pressure, which | ||
| # trades speed for reliability — give it room before --atomic rolls back. | ||
| TIMEOUT ?= 30m |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Update the documented default timeout.
Line 60 now sets TIMEOUT to 30m, but docs/components/deployment/gitops/README.md:488-506 still documents TIMEOUT ?= 10m. Update the README so deployment guidance matches the actual --timeout used by deploy-insight.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@deploy/gitops/Makefile` around lines 57 - 60, Update the deployment guidance
in the GitOps README to document TIMEOUT ?= 30m, matching the default defined in
the Makefile and used by deploy-insight’s --timeout option. Preserve the
surrounding deployment instructions and examples.
|
The deploy-time gold build can exceed its query memory cap on large
instances: the external group-by/sort thresholds spill aggregation and
sort state, but hash-join tables spill under neither, so join-heavy
observation models fail outright once they outgrow the cap.
join_algorithm: grace_hash,hash— joins partition to disk underpressure; plain hash fallback for join shapes grace does not support.
model — the last observation view — is materialized as a sorted
table like its siblings, and wiki gains the bounds it shipped
without.
--atomictimeout 10m → 30m: it bounds rollout waits plus themigrate hook, and spilling builds are deliberately slower — dbt's
per-query timeout (25m) was pointless with helm rolling back at 10.
Settings verified to reach ClickHouse on the build inserts; results
unchanged.
🤖 Generated with Claude Code
Summary by CodeRabbit
Performance
Bug Fixes