From aa9a129de3a7860c9d1db239ee4c23940eb40759 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Thu, 25 Jan 2024 10:02:41 -0500 Subject: [PATCH v1] Temporary patch to help debug pg_walsummary test failures. The tests in 002_blocks.pl are failing in the buildfarm from time to time, but we don't know how to reproduce the failure elsewhere. The most obvious explanation seems to be the unexpected disappearance of a WAL summary file, so bump up the logging level in RemoveWalSummaryIfOlderThan to try to help us spot such problems. Also adjust 002_blocks.pl to dump out a directory listing of the relevant directory at various points. This patch should be reverted once we sort out what's happening here. --- src/backend/backup/walsummary.c | 3 ++- src/bin/pg_walsummary/t/002_blocks.pl | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/backend/backup/walsummary.c b/src/backend/backup/walsummary.c index b549673a9d..bef75a9b47 100644 --- a/src/backend/backup/walsummary.c +++ b/src/backend/backup/walsummary.c @@ -251,7 +251,8 @@ RemoveWalSummaryIfOlderThan(WalSummaryFile *ws, time_t cutoff_time) ereport(ERROR, (errcode_for_file_access(), errmsg("could not stat file \"%s\": %m", path))); - ereport(DEBUG2, + /* XXX: was DEBUG2, temporarily increased to LOG */ + ereport(LOG, (errmsg_internal("removing file \"%s\"", path))); } diff --git a/src/bin/pg_walsummary/t/002_blocks.pl b/src/bin/pg_walsummary/t/002_blocks.pl index d609d2c547..40908da8cb 100644 --- a/src/bin/pg_walsummary/t/002_blocks.pl +++ b/src/bin/pg_walsummary/t/002_blocks.pl @@ -48,6 +48,7 @@ SELECT summarized_tli, summarized_lsn FROM pg_get_wal_summarizer_state() EOM ($summarized_tli, $summarized_lsn) = split(/\|/, $progress); note("after insert, summarized TLI $summarized_tli through $summarized_lsn"); +note_wal_summary_dir("after insert", $node1); # Update a row in the first block of the table and trigger a checkpoint. $node1->safe_psql('postgres', <data_dir; + my @wsfiles = grep { $_ ne '.' && $_ ne '..' } slurp_dir($wsdir); + note("$flair pg_wal/summaries has: @wsfiles"); +} -- 2.39.3 (Apple Git-145)