Skip to content
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

Postgres unavailable events go to DLQ without any retries #10396

Closed
3 tasks done
tiina303 opened this issue Jun 21, 2022 · 4 comments
Closed
3 tasks done

Postgres unavailable events go to DLQ without any retries #10396

tiina303 opened this issue Jun 21, 2022 · 4 comments
Labels
bug Something isn't working right feature/ingestion feature/persons Feature Tag: Persons plugin-server

Comments

@tiina303
Copy link
Contributor

tiina303 commented Jun 21, 2022

Bug description

For various reasons we can be in a situation for a short time period we can't write to postgres, e.g. maintenance, connection error, ...
Currently what happens is we send the event to Dead Letter Queue. We should add some retries, so short Postgres unavailability won't cause us to lose events.

How to reproduce

  1. make postgres read only for a brief time
  2. see that events trying to change/update persons data went to DLQ

Environment

  • PostHog Cloud
  • self-hosted PostHog (ClickHouse-based), version/commit: please provide
  • self-hosted PostHog (Postgres-based, legacy), version/commit: please provide

Additional context

Thank you for your bug report – we love squashing them!

@tiina303 tiina303 added bug Something isn't working right feature/ingestion labels Jun 21, 2022
@macobo macobo added feature/persons Feature Tag: Persons plugin-server labels Jun 22, 2022
@tiina303 tiina303 changed the title Postgres write failure - no retries Postgres unavailable events go to DLQ without any retries Jun 22, 2022
@smartpierre
Copy link

Hi, we made a quick upgrade on our PostgreSQL server and we're experiencing this issue (DLQ doesn't flush). While I understand there's nothing in place to automatically retry the events, is there a way to do this manually ?
Thanks !

@tiina303
Copy link
Contributor Author

tiina303 commented Jul 21, 2022

Hi, if you would like to do this manually on your self-hosted instance you certainly can. Something to be aware is that for person properties overriding we don't look at timestamps, so if you send some of these events now, then they might get the property values that were old (you can just look through the data to see if that's a concern on your side or not).

So how to do it:

  1. get the data from DLQ table - you can just query the table in clickhouse
  2. send those events to PostHog (I suggest writing a small script for this, e.g. in python & using the timestamps from the original events)

Let me know if you have any questions :)

@smartpierre
Copy link

Alright, I'll try ! Thanks :)

@tiina303
Copy link
Contributor Author

tiina303 commented Nov 6, 2023

we have retries now

@tiina303 tiina303 closed this as completed Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right feature/ingestion feature/persons Feature Tag: Persons plugin-server
Projects
None yet
Development

No branches or pull requests

3 participants