Skip to content

feat(web-analytics): add dagster job to clear precompute oom pins - #69969

Merged
lricoy merged 5 commits into
masterfrom
lricoy/wa-clear-oom-pins
Jul 11, 2026
Merged

feat(web-analytics): add dagster job to clear precompute oom pins#69969
lricoy merged 5 commits into
masterfrom
lricoy/wa-clear-oom-pins

Conversation

@lricoy

@lricoy lricoy commented Jul 10, 2026

Copy link
Copy Markdown
Member

Problem

Teams whose precompute inserts OOM get pinned (inserts capped to 1-day windows, self-expiring in 14 days). When the underlying pressure is gone - a cluster upscale, a stored-row cap reduction - there is no operator tool to clear a pin early, so the team pays fragmented inserts for up to two weeks.

Changes

  • Redis helpers on the pin module: clear_team_oom_pin, list_oom_pinned_team_ids.
  • New Dagster job web_analytics_clear_precompute_oom_pins, run manually from the Dagster UI:
    • no run config: dry run, lists pinned teams and clears nothing
    • team_id: <id>: clears that team's pin
    • clear_all: true: clears every pin (explicit config is the confirmation)
    • team_id + clear_all together fail the run without clearing anything

Started as a management command; converted to a Dagster job so operators get run history, logs, and the UI instead of shell access to a pod.

How did you test this code?

  • Job tests via execute_in_process cover the four config shapes: dry run clears nothing, single-team clear leaves other pins, clear_all clears everything, conflicting config fails closed. These catch the two review-flagged regressions (unguarded global clear, silently resolved conflicting modes) in the Dagster form.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Authored with Claude Code. First iteration was a management command; review added a --yes guard and mutually exclusive flags, then Lucas asked for a Dagster job instead - the dry-run-by-default config replaces the confirmation flag, and the conflicting-config failure preserves the exclusivity guarantee.

@greptile-apps

greptile-apps Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "feat(web-analytics): add management comm..." | Re-trigger Greptile

Comment thread products/web_analytics/backend/management/commands/clear_precompute_oom_pins.py Outdated
Comment thread products/web_analytics/backend/management/commands/clear_precompute_oom_pins.py Outdated
@trunk-io

trunk-io Bot commented Jul 10, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@lricoy lricoy changed the title feat(web-analytics): add management command to clear precompute oom pins feat(web-analytics): add dagster job to clear precompute oom pins Jul 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🤖 CI report

Playwright — all passed

All tests passed.

View test results →

lricoy added 2 commits July 10, 2026 15:39
…-pins

# Conflicts:
#	products/web_analytics/backend/hogql_queries/web_lazy_precompute_common.py
Comment thread products/web_analytics/dags/clear_oom_pins.py
@lricoy
lricoy merged commit a0d0005 into master Jul 11, 2026
238 checks passed
@lricoy
lricoy deleted the lricoy/wa-clear-oom-pins branch July 11, 2026 00:55
@deployment-status-posthog

deployment-status-posthog Bot commented Jul 11, 2026

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-07-11 01:17 UTC Run
prod-us ✅ Deployed 2026-07-11 01:29 UTC Run
prod-eu ✅ Deployed 2026-07-11 01:30 UTC Run

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.

1 participant