top | item 33371893

(no title)

pweissbrod | 3 years ago

How would this work from a fault tolerance perspective? For example the listening application happens to be offline but the database is inserting records. How would the application catch up?

discuss

order

oa335|3 years ago

If the listener is offline, the Postgres will see that a subscriber is behind and mark more of internal data as needing to be retained - this will keep certain maintenance tasks from being run (i.e. VACUUM). If VACUUM is not run for long enough, it will cause a catastrophic failure in your DB.

The application can catch up when restarted, if it retains the last WAL position. When it restarts, can asks Postgres to start replaying from that point.

GordonS|3 years ago

It would catch up by reading the WAL files when it restarted - using this method, the WAL files will remain on disk until they've been read.

codaphiliac|3 years ago

beware of subscribers being down. wal file will fill-up and then you’ll loose messages.