PostgreSQL 9.4 – Query Conflicts in Streaming Replication

postgresqlpostgresql-9.4

When using Streaming Replication in Postgres 9.4, when a query makes the standby Postgres "start to count" the max_standby_streaming_delay, changes being made in the primary:

  1. Are dammed at the primary (not sent to standby) using the wal_keep_segments setting to limit that; OR
  2. Are sent to standby and stored locally (where?) at the standby for later processing?

Scenario 1 would lead to a bigger data loss in the event of a crash in the primary. On the other hand, the scenario 2 may lead to a filesystem being completely filled if the allowed dalay is too big.

Best Answer

They are stored in the replica's pg_xlog directory.