In Greenplum Database environments utilizing streaming replication, the standby master maintains synchronization with the primary master by continuously applying Write-Ahead Log (WAL) segments. A common issue arises when the standby master attempts to retrieve a WAL segment that the primary has already recycled or removed, leading to replication failure.
The standby master may be reported as "Down" on the Command Center.
Executing gpstate -f
displays:
Standby status = Standby host passive
...
No entries found in pg_stat_replication
Standby master logs contain errors such as:
ERROR: could not receive data from WAL stream: ERROR: requested WAL segment ############### has already been removed
This issue occurs when the standby master falls behind the primary master and the required WAL segments are no longer available on the primary due to removal. Without access to these segments, the standby cannot catch up and results in replication failure.
To restore replication, the standby master can be reinitialized to synchronize with the current state of the primary master.
Steps:
gpinitstandby -r
gpinitstandby -s <standby_hostname>
<standby_hostname>
with the actual hostname of your standby master server.gpstate -f