Re: pg_rewind WAL segments deletion pitfall
torikoshia <torikoshia@oss.nttdata.com>
From: torikoshia <torikoshia@oss.nttdata.com>
To: Polina Bungina <bungina@gmail.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>, cyberdemn@gmail.com,
pgsql-hackers@lists.postgresql.org
Date: 2023-06-28T13:28:13Z
Lists: pgsql-bugs, pgsql-hackers
Attachments
- pg_rewind-removes-wal-segments-reproduce2.sh (text/plain)
On 2022-09-29 17:18, Polina Bungina wrote: > I agree with your suggestions, so here is the updated version of > patch. Hope I haven't missed anything. > > Regards, > Polina Bungina Thanks for working on this! It seems like we are also facing the same issue. I tested the v3 patch under our condition, old primary has succeeded to become new standby. BTW when I used pg_rewind-removes-wal-segments-reproduce.sh attached in [1], old primary also failed to become standby: FATAL: could not receive data from WAL stream: ERROR: requested WAL segment 000000020000000000000007 has already been removed However, I think this is not a problem: just adding restore_command like below fixed the situation. echo "restore_command = '/bin/cp `pwd`/newarch/%f %p'" >> oldprim/postgresql.conf Attached modified reproduction script for reference. [1]https://www.postgresql.org/message-id/CAFh8B%3DnNiFZOAPsv49gffxHBPzwmZ%3D6Msd4miMis87K%3Dd9rcRA%40mail.gmail.com -- Regards, -- Atsushi Torikoshi NTT DATA CORPORATION
Commits
-
Fix newly introduced 010_keep_recycled_wals.pl
- 2fb3919356fb 17.3 landed
- 50010c6f6c4d 16.7 landed
- 93d8d4fe1255 15.11 landed
- 1c5fe56bc259 14.16 landed
- b5be29ecafe1 18.0 landed
-
Avoid deleting critical WAL segments during pg_rewind
- ea1649c352f6 16.6 landed
- e28cf2fbc222 15.10 landed
- cb844d66b587 17.2 landed
- ba25358413e4 14.15 landed
- 90bcc7c2db1d 18.0 landed