Event UUIDs are not unique
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39.9k
- Forks
- 3.4k
- Avg merge
- 7h 27m
- Merged PRs (30d)
- 222
Description
Bug Description
Events in PostHog (Cloud) have a uuid field. Presumably, this is intended to be a unique value. However, at least in our instance it's not.
Some rough calculations show that around 0.7% of our event UUIDs appear more than once with other events.
Practically, this means when joining on uuid only in sql queries, duplicate rows are returned where they shouldn't.
How to reproduce
See screenshots, or run this query.
select
uuid,
count() as uuid_count
from events
group by uuid
order by uuid_count desc
Additional context
Debug info
Session: https://us.posthog.com/project/sTMFPsFhdP1Ssg/replay/0195f5c1-8d84-7fd9-8dfe-7c98353c6079?t=10777
Admin: http://go/adminOrgUS/018a1aa0-fba1-0000-7c63-3525ad2656c8 (project ID 34169)
Sentry: http://go/sentryUS/34169
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Begin with the supplied SQL query against the events table and review the attached reproduction screenshots and debug links. The issue names no repository files or tests, so identify the event UUID generation path before determining how to verify that duplicate UUIDs no longer occur.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- analytics, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100