WAL contains references to invalid pages in hot standby

Andrus <kobruleht2@hot.ee>

From: Andrus <kobruleht2@hot.ee>
To: pgsql-general <pgsql-general@postgresql.org>
Date: 2022-11-26T16:06:05Z
Lists: pgsql-general
Hi!

WAL playback in hot standby server crashes  with "WAL contains 
references to invalid pages" error :

2022-11-26 17:48:12.889 EET [497] LOG:  restored log file 
"000000010000057900000064" from archive
2022-11-26 17:48:20.897 EET [497] LOG:  restored log file 
"000000010000057900000065" from archive
2022-11-26 17:48:26.564 EET [497] LOG:  restored log file 
"000000010000057900000066" from archive
2022-11-26 17:48:32.019 EET [497] LOG:  consistent recovery state 
reached at 579/66954858
2022-11-26 17:48:32.019 EET [495] LOG:  database system is ready to 
accept read only connections
2022-11-26 17:48:32.019 EET [497] WARNING:  page 11 of relation 
base/54455050/83221012 is uninitialized
2022-11-26 17:48:32.019 EET [497] CONTEXT:  WAL redo at 579/66967DB0 for 
Heap2/VISIBLE: cutoff xid 167913422 flags 0x01
2022-11-26 17:48:32.019 EET [497] PANIC:  WAL contains references to 
invalid pages
2022-11-26 17:48:32.019 EET [497] CONTEXT:  WAL redo at 579/66967DB0 for 
Heap2/VISIBLE: cutoff xid 167913422 flags 0x01
2022-11-26 17:48:34.315 EET [495] LOG:  startup process (PID 497) was 
terminated by signal 6: Aborted
2022-11-26 17:48:34.315 EET [495] LOG:  terminating any other active 
server processes
2022-11-26 17:48:34.330 EET [495] LOG:  database system is shut down

It looks like file 000000010000057900000067 is corrupted. I looked into 
this file and it contains data like other WAL files.

How to fix this error so that Wal playback can continue?

Master server is in Postgres 12 in Debian 10.3

Hot standby in Postgres 12 in WSL Debian 11.5

Can Debian version 10.3/11.5 difference cause this exception?

Andrus.