Re: Back-patch of: avoid multiple hard links to same WAL file after a crash
Noah Misch <noah@leadboat.com>
On Sun, Apr 20, 2025 at 02:53:39PM -0700, Noah Misch wrote:
> On Mon, Apr 14, 2025 at 09:19:35AM +0900, Michael Paquier wrote:
> > On Sun, Apr 13, 2025 at 11:51:57AM -0400, Tom Lane wrote:
> > > Noah Misch <noah@leadboat.com> writes:
> > > > Tom and Michael, do you still object to the test addition, or not? If there
> > > > are no new or renewed objections by 2025-04-20, I'll proceed to add the test.
>
> Pushed as commit 714bd9e. The failure so far is
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=skink&dt=2025-04-20%2015%3A36%3A35
> with these highlights:
>
> pg_ctl: server does not shut down
>
> 2025-04-20 17:27:35.735 UTC [1576688][postmaster][:0] LOG: received immediate shutdown request
> 2025-04-20 17:27:35.969 UTC [1577386][archiver][:0] FATAL: archive command was terminated by signal 3: Quit
> 2025-04-20 17:27:35.969 UTC [1577386][archiver][:0] DETAIL: The failed archive command was: cp "pg_wal/00000001000000000000006D" "/home/bf/bf-build/skink-master/HEAD/pgsql.build/testrun/recovery/045_archive_restartpoint/data/t_045_archive_restartpoint_primary_data/archives/00000001000000000000006D"
>
> The checkpoints and WAL creation took 30s, but archiving was only 20% done
> (based on file name 00000001000000000000006D) at the 360s PGCTLTIMEOUT. I can
> reproduce this if I test with valgrind --trace-children=yes. With my normal
> valgrind settings, the whole test file takes only 18s. I recommend one of
> these changes to skink:
>
> - Add --trace-children-skip='/bin/*,/usr/bin/*' so valgrind doesn't instrument
> "sh" and "cp" commands.
> - Remove --trace-children=yes
I gave that more thought. One can be more surgical than that, via
--trace-children-skip-by-arg='*cp "*' or similar. My previous message's two
options stop valgrind instrumentation at boundaries like pg_dumpall calling
system(pg_dump ...), since that execs /bin/sh to run pg_dump. If we wanted to
make it even more explicit and surgical, skink could use
--trace-children-skip-by-arg='*valgrind-ignore-child*' combined with:
--- a/src/test/perl/PostgreSQL/Test/Cluster.pm
+++ b/src/test/perl/PostgreSQL/Test/Cluster.pm
@@ -1404 +1404 @@ sub enable_restoring
- : qq{cp "$path/%f" "%p"};
+ : qq{cp "$path/%f" "%p" # valgrind-ignore-child};
@@ -1474 +1474 @@ sub enable_archiving
- : qq{cp "%p" "$path/%f"};
+ : qq{cp "%p" "$path/%f" # valgrind-ignore-child};
What's your preference?
> Andres, what do you think about making one of those skink configuration
> changes? Alternatively, I could make the test poll until archiving catches
> up. However, that would take skink about 30min, and I expect little value
> from 30min of valgrind instrumenting the "cp" command.
Commits
-
Test restartpoints in archive recovery.
- 4399d1055627 13.21 landed
- 41ffd9d6a724 14.18 landed
- e297ddcfb7d3 17.5 landed
- 91168a9ae38d 15.13 landed
- 4664de1826a8 16.9 landed
- 714bd9e3a733 18.0 landed
-
Reset InstallXLogFileSegmentActive after walreceiver self-initiated exit.
- 69a498eb6465 13.21 landed
- 3635a0a35aaf 14.18 landed
-
Skip WAL recycling and preallocation during archive recovery.
- a5b0c06daae9 13.21 landed
- 014a508009df 14.18 landed
- cc2c7d65fc27 15.0 cited
-
Don't ERROR on PreallocXlogFiles() race condition.
- cbed472a9341 13.21 landed
- 675b771ca5f2 14.18 landed
-
Revert "Add HINT for restartpoint race with KeepFileRestoredFromArchive()."
- e77d9cd4f52e 13.21 landed
- 47d2d2982729 14.18 landed
-
Remove XLogFileInit() ability to unlink a pre-existing file.
- d0b6acaf04a2 13.21 landed
- b494640e8297 14.18 landed
-
In XLogFileInit(), fix *use_existent postcondition to suit callers.
- 20e5ef3ca70c 13.21 landed
- 8967dddf086e 14.18 landed
-
Remove XLogFileInit() ability to skip ControlFileLock.
- df8ec9634ccd 13.21 landed
- 6b168c1299c5 14.18 landed
-
Replace durable_rename_excl() by durable_rename(), take two
- 26a79cbbdace 13.19 landed
- 1f95181b44c8 14.16 landed
- c1c9df3159cf 15.11 landed
- dac1ff30906b 16.0 landed
-
Add HINT for restartpoint race with KeepFileRestoredFromArchive().
- 8ad6c5dbbe5a 14.5 cited
-
Remove durable_rename_excl()
- eb64ceac7ec3 16.0 landed
- 2c902bbf1911 15.0 landed
-
Replace existing durable_rename_excl() calls with durable_rename()
- ccfbd9287d70 15.0 landed