ACTIVITY
Timeline
Timeline for the post: Standby PostgreSQL fails replay with 'invalid record length' after restoring base backup from different wal_segment_size
Currently licensed under: CC BY-SA 4.0
| When | What | By | License | Comment |
|---|---|---|---|---|
Oct 22, 2026, 9:30:52 AM 1mo ago | Solution accepted | astridapps | An answer was marked as the accepted solution. | |
Oct 22, 2026, 9:30:52 AM 1mo ago | Answer | alexnord | CC BY-SA 4.0 | Check pg_controldata on both primary and standby — if wal_segment_size differs, you must reinitialize the standby from a base backup taken from the primary. The WAL format depends on that size, so replaying incompatible WAL yields 'invalid record length'. Take a fresh pg_basebackup from the primary and start the standby from that backup; once replication is streaming and replaying cleanly, remove the old standby. Keep the old data directory offline for investigation but don’t run pg_resetwal unless you accept possible data loss. This restores safe replication with matching control data. |
Oct 22, 2026, 9:30:52 AM 1mo ago | Created | astridapps | CC BY-SA 4.0 | Standby PostgreSQL fails replay with 'invalid record length' after restoring base backup from different wal_segment_size |