Revert "Temporary patch to help debug pg_walsummary test failures."
authorNathan Bossart <[email protected]>
Wed, 20 Mar 2024 16:34:00 +0000 (11:34 -0500)
committerNathan Bossart <[email protected]>
Wed, 20 Mar 2024 16:34:00 +0000 (11:34 -0500)
Thanks to commits ea18eb7d62b6ee30ec08, and 19a829a327, the
002_blocks.pl test now consistently passes, so we can remove this
temporary debugging code.

This reverts commit 5ddf9973477729cf161b4ad0a1efd52f4fea9c88.

Discussion: https://postgr.es/m/20240314210010.GA3056455%40nathanxps13

src/backend/backup/walsummary.c
src/bin/pg_walsummary/t/002_blocks.pl

index 4d047e1c02f1edc6cf01099958bb1c5a0d4c53ec..322ae3c3ad11543bf7cc6a4da0da30fe935faa21 100644 (file)
@@ -252,15 +252,8 @@ RemoveWalSummaryIfOlderThan(WalSummaryFile *ws, time_t cutoff_time)
        ereport(ERROR,
                (errcode_for_file_access(),
                 errmsg("could not stat file \"%s\": %m", path)));
-   /* XXX temporarily changed to debug buildfarm failures */
-#if 0
    ereport(DEBUG2,
            (errmsg_internal("removing file \"%s\"", path)));
-#else
-   ereport(LOG,
-           (errmsg_internal("removing file \"%s\" cutoff_time=%llu", path,
-                            (unsigned long long) cutoff_time)));
-#endif
 }
 
 /*
index d4bae3d5649ba7ac01075483218f4c97d5d7ce33..52d3bd8840b2fe3cc64c4fc7f05cd6b56e71d996 100644 (file)
@@ -51,7 +51,6 @@ my $summarized_lsn = $node1->safe_psql('postgres', <<EOM);
 SELECT MAX(end_lsn) AS summarized_lsn FROM pg_available_wal_summaries()
 EOM
 note("after insert, summarized 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', <<EOM);
@@ -78,7 +77,6 @@ my @lines = split(/\n/, $details);
 is(0+@lines, 1, "got exactly one new WAL summary");
 my ($tli, $start_lsn, $end_lsn) = split(/\|/, $lines[0]);
 note("examining summary for TLI $tli from $start_lsn to $end_lsn");
-note_wal_summary_dir("after new summary", $node1);
 
 # Reconstruct the full pathname for the WAL summary file.
 my $filename = sprintf "%s/pg_wal/summaries/%08s%08s%08s%08s%08s.summary",
@@ -86,7 +84,6 @@ my $filename = sprintf "%s/pg_wal/summaries/%08s%08s%08s%08s%08s.summary",
                       split(m@/@, $start_lsn),
                       split(m@/@, $end_lsn);
 ok(-f $filename, "WAL summary file exists");
-note_wal_summary_dir("after existence check", $node1);
 
 # Run pg_walsummary on it. We expect exactly two blocks to be modified,
 # block 0 and one other.
@@ -96,16 +93,5 @@ note($stdout);
 like($stdout, qr/FORK main: block 0$/m, "stdout shows block 0 modified");
 is($stderr, '', 'stderr is empty');
 is(0+@lines, 2, "UPDATE modified 2 blocks");
-note_wal_summary_dir("after pg_walsummary run", $node1);
 
 done_testing();
-
-# XXX. Temporary debugging code.
-sub note_wal_summary_dir
-{
-   my ($flair, $node) = @_;
-
-   my $wsdir = sprintf "%s/pg_wal/summaries", $node->data_dir;
-   my @wsfiles = grep { $_ ne '.' && $_ ne '..' } slurp_dir($wsdir);
-   note("$flair pg_wal/summaries has: @wsfiles");
-}