]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix regex searching for page verification failures in tests
authorDaniel Gustafsson <dgustafsson@postgresql.org>
Wed, 6 May 2026 10:38:15 +0000 (12:38 +0200)
committerDaniel Gustafsson <dgustafsson@postgresql.org>
Wed, 6 May 2026 10:38:15 +0000 (12:38 +0200)
The test for finding page verification failures in the logfiles
were missing the /m modifier to make sure it anchors to every
newline in the search space buffer, and not just the last one.

Spotted while adding a test for the recently reported issue with
excessive WAL for unlogged relations.

Author: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Satyanarayana Narlapuram <satyanarlapuram@gmail.com>
Reviewed-by: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Discussion: https://postgr.es/m/CAHg+QDeGrpZbNZdLjd_T4b43xKEEXZN0HGhkFm-1bkBdyzK7AQ@mail.gmail.com

src/test/modules/test_checksums/t/006_pgbench_single.pl
src/test/modules/test_checksums/t/007_pgbench_standby.pl
src/test/modules/test_checksums/t/008_pitr.pl
src/test/modules/test_checksums/t/009_fpi.pl

index f5ccc1b5b082d84eccf55e6177febeadcb3a4fda..b0ccf05fce945516b717a43bec622fdb549914fe 100644 (file)
@@ -211,7 +211,7 @@ for (my $i = 0; $i < $TEST_ITERATIONS; $i++)
                        $node_loglocation);
                unlike(
                        $log,
-                       qr/page verification failed,.+\d$/,
+                       qr/page verification failed,.+\d$/m,
                        "no checksum validation errors in primary log (during WAL recovery)"
                );
                $node_loglocation = -s $node->logfile;
@@ -249,7 +249,7 @@ for (my $i = 0; $i < $TEST_ITERATIONS; $i++)
                        $node_loglocation);
                unlike(
                        $log,
-                       qr/page verification failed,.+\d$/,
+                       qr/page verification failed,.+\d$/m,
                        "no checksum validation errors in primary log (outside WAL recovery)"
                );
                $node_loglocation = -s $node->logfile;
@@ -276,7 +276,7 @@ my $log =
   PostgreSQL::Test::Utils::slurp_file($node->logfile, $node_loglocation);
 unlike(
        $log,
-       qr/page verification failed,.+\d$/,
+       qr/page verification failed,.+\d$/m,
        "no checksum validation errors in primary log");
 $node_loglocation = -s $node->logfile;
 
index 0b3996f1d69815c3d3489b008e916d9e0f3e3005..38e17ca38ee5335a02f5ca3e70afbd4d38c63f81 100644 (file)
@@ -270,7 +270,7 @@ for (my $i = 0; $i < $TEST_ITERATIONS; $i++)
                        $node_primary_loglocation);
                unlike(
                        $log,
-                       qr/page verification failed,.+\d$/,
+                       qr/page verification failed,.+\d$/m,
                        "no checksum validation errors in primary log (during WAL recovery)"
                );
                $node_primary_loglocation = -s $node_primary->logfile;
@@ -299,7 +299,7 @@ for (my $i = 0; $i < $TEST_ITERATIONS; $i++)
                        $node_standby_loglocation);
                unlike(
                        $log,
-                       qr/page verification failed,.+\d$/,
+                       qr/page verification failed,.+\d$/m,
                        "no checksum validation errors in standby_1 log (during WAL recovery)"
                );
                $node_standby_loglocation = -s $node_standby->logfile;
@@ -341,7 +341,7 @@ for (my $i = 0; $i < $TEST_ITERATIONS; $i++)
                        $node_primary_loglocation);
                unlike(
                        $log,
-                       qr/page verification failed,.+\d$/,
+                       qr/page verification failed,.+\d$/m,
                        "no checksum validation errors in primary log (outside WAL recovery)"
                );
                $node_primary_loglocation = -s $node_primary->logfile;
@@ -363,7 +363,7 @@ for (my $i = 0; $i < $TEST_ITERATIONS; $i++)
                        $node_standby_loglocation);
                unlike(
                        $log,
-                       qr/page verification failed,.+\d$/,
+                       qr/page verification failed,.+\d$/m,
                        "no checksum validation errors in standby_1 log (outside WAL recovery)"
                );
                $node_standby_loglocation = -s $node_standby->logfile;
@@ -394,14 +394,14 @@ my $log = PostgreSQL::Test::Utils::slurp_file($node_primary->logfile,
        $node_primary_loglocation);
 unlike(
        $log,
-       qr/page verification failed,.+\d$/,
+       qr/page verification failed,.+\d$/m,
        "no checksum validation errors in primary log");
 $node_primary_loglocation = -s $node_primary->logfile;
 $log = PostgreSQL::Test::Utils::slurp_file($node_standby->logfile,
        $node_standby_loglocation);
 unlike(
        $log,
-       qr/page verification failed,.+\d$/,
+       qr/page verification failed,.+\d$/m,
        "no checksum validation errors in standby_1 log");
 $node_standby_loglocation = -s $node_standby->logfile;
 
index 1f8176686fdd318a146cb1960ba886d188f578ab..913377c9d327c64daf93ac9c5dd50d29b5c10eb2 100644 (file)
@@ -186,7 +186,7 @@ $node_pitr->stop;
 my $log = PostgreSQL::Test::Utils::slurp_file($node_pitr->logfile, 0);
 unlike(
        $log,
-       qr/page verification failed,.+\d$/,
+       qr/page verification failed,.+\d$/m,
        "no checksum validation errors in pitr log");
 
 done_testing();
index a1cea91f78795b9723aa97f91824ead8aedd1790..1a7dcd0e15d1b4afd06e1be454314153ca64be5b 100644 (file)
@@ -58,7 +58,7 @@ $node->stop;
 my $log = PostgreSQL::Test::Utils::slurp_file($node->logfile, 0);
 unlike(
        $log,
-       qr/page verification failed,.+\d$/,
+       qr/page verification failed,.+\d$/m,
        "no checksum validation errors in server log");
 
 done_testing();