Postgresql – Does PostgreSQL 9.1 Streaming Replication catch up after a lag without WAL archiving

postgresqlreplication

Context:

Let's say that, while using Streaming Replication/Hot Standby on a Postgres 9.1 cluster, a standby node goes down. It stays down for an day, during which time a lot of DML occurs on the master. The standby's recovery.conf doesn't contain a 'restore_command' entry (for restoring from WAL journal files), but does contain a 'primary_conninfo' string (for Streaming Replication).

Question:

If I start the standby again after a day of changes on the master. Will it "catch up" (eventually come into a state which mirrors the master) using only Streaming Replication? Or do I have to enable WAL file archiving and let it apply files archived during the outage to ensure currency?

I've checked the WAL archiving/streaming replication doc here, and it says that you don't have to enable both WAL archiving and Streaming Replication, but it is unclear whether or not catch-up will happen without WAL file archiving being enabled.

Thanks!

Best Answer

Yes, it will catch up, using streaming only, if (and only if), the number of WAL segments generated since the last update on the standby is less than the value of wal_keep_segments in postgresql.conf. This is covered in this section of the documentation: Replication