:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(dags): put squash_person_overrides under the deletes concurrency limit (#122679)
Paweł Szczur16785ec50c5f
diff --git a/docs/internal/clickhouse-deletion-coverage.md b/docs/internal/clickhouse-deletion-coverage.mdindex 62cfe06ed746..1e5066aca05d 100644--- a/docs/internal/clickhouse-deletion-coverage.md+++ b/docs/internal/clickhouse-deletion-coverage.md@@ -334,7 +334,7 @@ Staff set the retention in Django admin, on the team and organization pages:A manual run can narrow the plan with `team_ids` and `partitions`. A listed team with no retention is ignored.`monthly_old_events_cleanup_schedule` starts one run on the 1st of each month, in every region, and skips when no retention is set. It is stopped by default.The job runs `ensure_no_concurrent_deletes_run` before it plans, and that guard also runs in `deletes_job`. Each job fails at the start while a `deletes_job`, cleanup or squash run is executing, so the two never mutate the events tables at the same time.-Both jobs carry the `deletes_job_concurrency` tag, so with a run-queue limit of 1 on that tag in the Dagster deployment settings, a second run queues instead of failing the guard.+Both jobs and `squash_person_overrides` carry the `deletes_job_concurrency` tag. The Dagster deployment settings put a run-queue limit of 1 on that tag, so a second run of any of the three queues instead of starting.`sharded_events_json` keeps events dated before 2020, because it stores them in its 202001 partition and the delete addresses the event's own month.## Adding a tablediff --git a/posthog/dags/person_overrides.py b/posthog/dags/person_overrides.pyindex ca038df45d72..52d51b74762f 100644--- a/posthog/dags/person_overrides.py+++ b/posthog/dags/person_overrides.py@@ -412,7 +412,15 @@ def record_squash_run_failure(context: dagster.HookContext) -> None:# Job Definition[email protected](tags={"owner": JobOwners.TEAM_CLICKHOUSE.value}, hooks={record_squash_run_failure})+ tags={+ "owner": JobOwners.TEAM_CLICKHOUSE.value,+ # Shares the run-queue limit with deletes_job and monthly_old_events_cleanup_job, because+ # all three mutate the events tables. A squash run then queues while either of them runs.+ "deletes_job_concurrency": "v1",+ },+ hooks={record_squash_run_failure},+)def squash_person_overrides():prepared_snapshot_table = wait_for_snapshot_table_replication(populate_snapshot_table(create_snapshot_table()))prepared_dictionary = load_and_verify_snapshot_dictionary(create_snapshot_dictionary(prepared_snapshot_table))