v1-0001-Fix-046_checkpoint_-logical-physical-_slot.pl-exe.patch

application/octet-stream

Filename: v1-0001-Fix-046_checkpoint_-logical-physical-_slot.pl-exe.patch
Type: application/octet-stream
Part: 0
Message: Re: Slot's restart_lsn may point to removed WAL segment after hard restart unexpectedly

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: format-patch
Series: patch v1-0001
Subject: Fix 046_checkpoint_(logical/physical)_slot.pl execution time
File+
src/test/recovery/t/046_checkpoint_logical_slot.pl 4 4
src/test/recovery/t/047_checkpoint_physical_slot.pl 4 4
From db591b3c0b9ae760395f79df68ca78922108e7f4 Mon Sep 17 00:00:00 2001
From: Alexander Korotkov <akorotkov@postgresql.org>
Date: Sun, 15 Jun 2025 13:54:09 +0300
Subject: [PATCH v1] Fix 046_checkpoint_(logical/physical)_slot.pl execution
 time

Reported-by:
Bug:
Discussion:
Author:
Reviewed-by:
Tested-by:
Backpatch-through:
---
 src/test/recovery/t/046_checkpoint_logical_slot.pl  | 8 ++++----
 src/test/recovery/t/047_checkpoint_physical_slot.pl | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/test/recovery/t/046_checkpoint_logical_slot.pl b/src/test/recovery/t/046_checkpoint_logical_slot.pl
index b4265c4a6a5..4fe928210dd 100644
--- a/src/test/recovery/t/046_checkpoint_logical_slot.pl
+++ b/src/test/recovery/t/046_checkpoint_logical_slot.pl
@@ -58,17 +58,17 @@ SELECT 1 \watch 0.1
 \q
 ));
 
-# Insert 2M rows; that's about 260MB (~20 segments) worth of WAL.
+# Insert 50K rows; that's about 86MB (~5 segments) worth of WAL.
 $node->safe_psql('postgres',
-	q{insert into t (b) select md5(i::text) from generate_series(1,1000000) s(i)}
+	q{insert into t (b) select repeat(md5(i::text),50) from generate_series(1,50000) s(i)}
 );
 
 # Run another checkpoint to set a new restore LSN.
 $node->safe_psql('postgres', q{checkpoint});
 
-# Another 2M rows; that's about 260MB (~20 segments) worth of WAL.
+# Another 50K rows; that's about 86MB (~5 segments) worth of WAL.
 $node->safe_psql('postgres',
-	q{insert into t (b) select md5(i::text) from generate_series(1,1000000) s(i)}
+	q{insert into t (b) select repeat(md5(i::text),50) from generate_series(1,50000) s(i)}
 );
 
 # Run another checkpoint, this time in the background, and make it wait
diff --git a/src/test/recovery/t/047_checkpoint_physical_slot.pl b/src/test/recovery/t/047_checkpoint_physical_slot.pl
index 454e56b9bd2..3141b256bf3 100644
--- a/src/test/recovery/t/047_checkpoint_physical_slot.pl
+++ b/src/test/recovery/t/047_checkpoint_physical_slot.pl
@@ -43,9 +43,9 @@ $node->safe_psql('postgres',
 # Run checkpoint to flush current state to disk and set a baseline.
 $node->safe_psql('postgres', q{checkpoint});
 
-# Insert 2M rows; that's about 260MB (~20 segments) worth of WAL.
+# Insert 50K rows; that's about 86MB (~5 segments) worth of WAL.
 $node->safe_psql('postgres',
-	q{insert into t (b) select md5(i::text) from generate_series(1,100000) s(i)}
+	q{insert into t (b) select repeat(md5(i::text),50) from generate_series(1,50000) s(i)}
 );
 
 # Advance slot to the current position, just to have everything "valid".
@@ -56,9 +56,9 @@ $node->safe_psql('postgres',
 # Run another checkpoint to set a new restore LSN.
 $node->safe_psql('postgres', q{checkpoint});
 
-# Another 2M rows; that's about 260MB (~20 segments) worth of WAL.
+# Another 50K rows; that's about 86MB (~5 segments) worth of WAL.
 $node->safe_psql('postgres',
-	q{insert into t (b) select md5(i::text) from generate_series(1,1000000) s(i)}
+	q{insert into t (b) select repeat(md5(i::text),50) from generate_series(1,50000) s(i)}
 );
 
 my $restart_lsn_init = $node->safe_psql('postgres',
-- 
2.39.5 (Apple Git-154)