PostHog / plugin-server

Service to process and save PostHog events, supporting JS/TS plugins at that
https://posthog.com
8 stars 5 forks source link

Insert distinct ID error #526

Closed yakkomajuri closed 3 years ago

yakkomajuri commented 3 years ago

Seems we fail multiple times a second on Cloud to insert a distinct ID into Postgres.

This makes sense, given a user that triggers an event is likely to trigger multiple and we see a ton of new users (distinct IDs) every day, meaning it's quite likely two events for the same non-existent ID will end up on different threads at the same time.

We do handle this properly but:

a) we swallow errors b) we're doing a lot of supposedly unnecessary queries and relying heavily on erroring as default behavior

I believe there should be ways to improve this. Have a couple ideas but mostly just documenting for now.

yakkomajuri commented 3 years ago

Somewhat handled in #527