Re: pgsql: Add TAP test for archive_cleanup_command and recovery_end_comman
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Michael Paquier <michael@paquier.xyz>,
Thomas Munro <thomas.munro@gmail.com>,
pgsql-hackers@lists.postgresql.org
Date: 2022-04-08T21:55:51Z
Lists: pgsql-hackers
Attachments
- 002_archiving-hack.patch (text/x-diff) patch
Andres Freund <andres@anarazel.de> writes: > On 2022-04-07 13:57:45 -0400, Tom Lane wrote: >> Yeah, with only one instance it could just be cosmic rays or something. >> However, assuming it is real, I guess I wonder why we don't say >> CHECKPOINT_FORCE in standby mode too. > I guess it might partially be that restartpoints require a checkpoint to have > happened on the primary. If we used FORCE, we'd have to wait till the next > checkpoint on the primary, which'd be a problem if it's e.g. a manually issued > CHECKPOINT; before shutting the standby down. After seeing skink's results, I tried running that test under valgrind here, and it fails just like that every time. skink's history allows us to bound the failure introduction between 79b716cfb7 and d7ab2a9a3c, which I think makes it just about certain that it was 5dc0418fab (Prefetch data referenced by the WAL, take II), though I've not bisected to be 100% sure. Adding some debug printouts to ExecuteRecoveryCommand convinces me that indeed the archive_cleanup_command is NOT getting called by the problematic CHECKPOINT command. I surmise based on Andres' comment above that the standby isn't making a restartpoint for lack of an available primary checkpoint, which looks to me like it could be a pre-existing bug in the test case: it's sure not doing anything to guarantee that the primary's checkpoint record has reached the standby. I tried adjusting the patch so it does guarantee that (as attached), and in two out of two tries it got past the archive_cleanup_command failure but then hung up waiting for standby2 to promote. On the whole, I'm not sure that the WAL prefetch logic is noticeably more stable than when we booted it out last year :-(. However, I also wonder why it is that this test case wasn't occasionally failing already. regards, tom lane
Commits
-
Fix second race condition in 002_archiving.pl with archive_cleanup_command
- 1a8b110539ef 15.0 landed
-
Fix race in TAP test 002_archiving.pl when restoring history file
- 4751a13b63de 11.16 landed
- a57399d70c7a 12.11 landed
- a6fc64b9a85e 13.7 landed
- 8bcf90c7a67c 14.3 landed
- e61efafcb82c 15.0 landed
-
Don't retry restore_command while reading ahead.
- acf1dd42342d 15.0 landed
-
Add TAP test for archive_cleanup_command and recovery_end_command
- 46dea2419ee7 15.0 cited