Re: pgsql: Add TAP test for archive_cleanup_command and recovery_end_comman

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Andres Freund <andres@anarazel.de>, Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-04-18T04:55:13Z
Lists: pgsql-hackers
On Tue, Apr 12, 2022 at 12:49:48PM +0900, Michael Paquier wrote:
> This comes from df86e52, where we want to recovery a history file that
> would be created as RECOVERYHISTORY and make sure that the file gets
> removed at the end of recovery.  So $standby2 should choose a new
> timeline different from the one of chosen by $standby.  Looking back
> at what has been done, it seems to me that the comment is the
> incorrect part:
> https://www.postgresql.org/message-id/20190930080340.GO2888@paquier.xyz

acf1dd42 has taken care of the failures of this test with skink, and I
have just taken care of the two races in the tests with e61efaf and
1a8b110.  I have left e61efaf out of REL_10_STABLE as the idea of
relying on a poll_query_until() with pg_stat_file() and an absolute
path would not work there, and the branch will be EOL'd soon while
there were no complains with this test for two years.
--
Michael

Commits

  1. Fix second race condition in 002_archiving.pl with archive_cleanup_command

  2. Fix race in TAP test 002_archiving.pl when restoring history file

  3. Don't retry restore_command while reading ahead.

  4. Add TAP test for archive_cleanup_command and recovery_end_command