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

[Note for best practices] #27

Open
lsfera opened this issue Aug 1, 2024 · 0 comments
Open

[Note for best practices] #27

lsfera opened this issue Aug 1, 2024 · 0 comments

Comments

@lsfera
Copy link
Contributor

lsfera commented Aug 1, 2024

Playing on pre production environment I've just stumbled into this exception raised by subscriber: Npgsql.PostgresException (0x80004005): 55000: cannot read from logical replication slot "slot_name".
Publication comes from a low frequency use case, hence no surprise - even if max_slot_wal_keep_size value can easily accomodate over two days of transaction logs.
The WAL LSN (Log Sequence Number) the subscriber is referring to in received_lsn from see pg_stat_subscription can become unreachable when the belonging wal segment becomes unreachable due to retention policy value, causing any attempt to resume reading from the stream failing miserably.

Force recreating the subscription slot is in this case is my suggested approach to recover the flow, since this is a perfectly legit use case in our scenario *...In the end we are just cherry picking our business use case from the whole db transaction log, so we have to prepare some unplanned stuff.

* I simply extended the worker policy with specific code see

For convenience I've just added a playground to test the use case - run the file in a pws shell and follow the instructions

lsfera added a commit to lsfera/Postgresql.Outbox that referenced this issue Aug 1, 2024
lsfera added a commit to lsfera/Postgresql.Outbox that referenced this issue Aug 1, 2024
lsfera added a commit to lsfera/Postgresql.Outbox that referenced this issue Aug 1, 2024
lsfera added a commit to lsfera/Postgresql.Outbox that referenced this issue Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant