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

fix: listener silent fail on replica #3533

Merged
merged 2 commits into from
May 19, 2024

Conversation

steve-chavez
Copy link
Member

@steve-chavez steve-chavez commented May 18, 2024

Update hasql-notifications to include the fix on diogob/hasql-notifications#24.

Which now reveals the following error:

$ postgrest-with-postgresql-16 --replica -f test/spec/fixtures/load.sql postgrest-run

17/May/2024:18:35:38 -0500: Successfully connected to PostgreSQL 16.2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 13.2.0, 64-bit
17/May/2024:18:35:38 -0500: Failed listening for notifications on the "pgrst" channel. ERROR:  cannot execute LISTEN during recovery
17/May/2024:18:35:38 -0500: Retrying listening for notifications...

This is still not good because the LISTEN channel will be retried forever (with an unnecessary schema cache reload too) without a backoff.

When using `postgrest-with-postgresql-* --replica`, the PGRST_DB_URI
will set the replica host as preference. This to be able to run
quick manual tests with postgrest running on a replica.
Update hasql-notifications to include the fix on
diogob/hasql-notifications#24.

Which now reveals the following error:

```
$ postgrest-with-postgresql-16 --replica -f test/spec/fixtures/load.sql postgrest-run

17/May/2024:18:35:38 -0500: Successfully connected to PostgreSQL 16.2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 13.2.0, 64-bit
17/May/2024:18:35:38 -0500: Could not listen for notifications on the "pgrst" channel. ERROR:  cannot execute LISTEN during recovery
17/May/2024:18:35:38 -0500: Retrying listening for notifications...
```

This is still not good because the LISTEN channel will be retried
forever without a backoff.
@steve-chavez
Copy link
Member Author

This is still not good because the LISTEN channel will be retried forever (with an unnecessary schema cache reload too) without a backoff.

Tried to fix that here but it's causing some test failures that only occur on CI (hard to debug). Will make the backoff in another PR to have less changes to track.

Linkcheck fails Patreon permanently.

@steve-chavez steve-chavez merged commit 756aad7 into PostgREST:main May 19, 2024
48 of 51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant