-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: make delete dag dependent on current most recent squash job results #28243
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR modifies the person event deletion process to ensure it only processes events that have been properly squashed by the person overrides job.
- Added
get_oldest_person_override_timestamp
operation in/dags/deletes.py
to establish a high watermark for deletions - Modified
squash_person_overrides
job in/dags/person_overrides.py
to pass timestamp through newpass_the_torch
operation - Increased ClickHouse client timeout to 24 hours and added strict mutation sync settings in
ClickhouseClusterResource
- Added UUID-based ZooKeeper paths for table replication to prevent conflicts
- Added comprehensive test coverage in
/dags/tests/test_deletes.py
to validate the new timestamp-dependent behavior
3 file(s) reviewed, 6 comment(s)
Edit PR Review Bot Settings | Greptile
query = f""" | ||
SELECT min(_timestamp) FROM {PERSON_DISTINCT_ID_OVERRIDES_TABLE} | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: query could return NULL if table is empty, which would cause a runtime error when unpacking result
oops! Co-authored-by: ted kaemming <[email protected]>
Problem
The delete job is quite dependent on the current state of the world of person overrides squashing
Changes
This makes the delete job dependent on the min
_timestamp
seen in person overrides table so that we only delete person events that have been squashed.We do this by having a starting op that grabs the high watermark for person overrides and only deletes events before that.
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Does this work well for both Cloud and self-hosted?
How did you test this code?