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

feat: add db-channel-uri config to allow reload using NOTIFY for read replicas #3416

Closed
wants to merge 1 commit into from

Conversation

laurenceisla
Copy link
Member

Should close #3414.

Applies to the cases where a PostgREST instance connects to a Read Replica. Then, the db-channel-uri config can be used to set a connection to the Primary DB, allowing PostgREST to reload when an Event Trigger is executed in that Primary DB.

Comment on lines 518 to 521
connectionWorker appState
-- TODO: debounce
-- retry the listener
listener appState conf
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a debounce for when the connection is lost or the db-channel-uri has an error.

Since this should apply only when db-channel-uri is set, perhaps it should run conditionally, like:

Suggested change
connectionWorker appState
-- TODO: debounce
-- retry the listener
listener appState conf
when (isNothing dbChannel) $
connectionWorker appState
-- TODO: debounce
-- retry the listener
listener appState conf

@wolfgangwalther
Copy link
Member

I don't like this approach and suggested an alternative here: #3414 (comment)

@steve-chavez
Copy link
Member

Let's try Wolfgang's approach.

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.

Event triggers don't work on read replicas
3 participants