Re: standby promotion can create unreadable WAL
Sami Imseih <simseih@amazon.com>
From: "Imseih (AWS), Sami" <simseih@amazon.com>
To: Robert Haas <robertmhaas@gmail.com>, Dilip Kumar <dilipbalaut@gmail.com>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, "Alvaro
Herrera" <alvherre@alvh.no-ip.org>, Andres Freund <andres@anarazel.de>
Date: 2022-08-26T15:59:10Z
Lists: pgsql-hackers
> I agree. Testing StandbyMode here seems bogus. I thought initially > that the test should perhaps be for InArchiveRecovery rather than > ArchiveRecoveryRequested, but I see that the code which switches to a > new timeline cares about ArchiveRecoveryRequested, so I think that is > the correct thing to test here as well. > Concretely, I propose the following patch. This patch looks similar to the change suggested in https://www.postgresql.org/message-id/FB0DEA0B-E14E-43A0-811F-C1AE93D00FF3%40amazon.com to deal with panics after promoting a standby. The difference is the patch tests !ArchiveRecoveryRequested instead of !StandbyModeRequested as proposed in the mentioned thread. Thanks -- Sami Imseih Amazon Web Services
Commits
-
Prevent WAL corruption after a standby promotion.
- 0b3ff539dd34 10.23 landed
- 002fba80ebde 11.18 landed
- 3c0ef0832748 12.13 landed
- 3f2701cda590 13.9 landed
- 0e54a5e27494 14.6 landed
- eb29fa38895c 15.0 landed
- 6672d7913929 16.0 landed
-
Use correct LSN for error reporting in pg_walinspect
- d9fbb8862959 16.0 cited