Top
Enterprise Postgres 17 SP1 Userlog Operation Guide

1.4 Relationship to Replication

Replication ensures that the extracted files are exactly the same between two directly connected instances.

There is a mechanism to accomplish this, which requires setting parameters. This is explained here.

The upstream replication instance should extract userlogs only to the extent that they were written to the downstream instance's WAL. Upstream and downstream refer to the case of a primary and its connected standby, and the relationship between two directly connected standbys in cascading replication. Without this constraint, the aforementioned identity cannot be guaranteed. For example, suppose you have two instances of synchronous replication that go down during transaction commit. With this configuration, there can be moments on disk where the primary is emitting a COMMIT log and the standby is not (Of course, from the application's point of view at this moment, the COMMIT has not been completed.). In this state, if the primary extraction daemon detects a COMMIT log and emits a userlog immediately, the userlog is in COMMIT state. However, if the primary goes down shortly afterwards and the standby is promoted, the promoted side will extract the userlog in ROLLBACK state because there will be no COMMIT log.

To avoid this, the downstream side extracts the userlog only within WAL records that have been written. To control this, the userlog.standby_names parameter should contain the names of instances that are at least downstream of the extraction daemon process. Refer to "Chapter 2 Setup" or a more detailed specification of this parameter.