Subject: Re: Switching XLog source from archive to streaming when primary available

From: Japin Li <[email-masked]>
Date: Mon, 19 Feb 2024 22:55:43 +0800

On Mon, 19 Feb 2024 at 18:36, Bharath Rupireddy <[email-masked]> wrote:
> On Wed, Jan 31, 2024 at 6:30 PM Bharath Rupireddy
> <[email-masked]> wrote:
>>
>> Needed a rebase due to commit 776621a (conflict in
>> src/test/recovery/meson.build for new TAP test file added). Please
>> find the attached v17 patch.
>
> Strengthened tests a bit by using recovery_min_apply_delay to mimic
> standby spending some time fetching from archive. PSA v18 patch.

Here are some minor comments:

[1]
+        primary). However, the standby exhausts all the WAL present in pg_wal

s|pg_wal|<filename>pg_wal</filename>|g

[2]
+# Ensure checkpoint doesn't come in our way
+$primary->append_conf('postgresql.conf', qq(
+    min_wal_size = 2MB
+    max_wal_size = 1GB
+    checkpoint_timeout = 1h
+	autovacuum = off
+));

Keeping the same indentation might be better.

---

From: Bharath Rupireddy <[email-masked]>
Date: Tue, 20 Feb 2024 11:10:19 +0530

> Here are some minor comments:

Thanks for taking a look at it.

> s|pg_wal|<filename>pg_wal</filename>|g

Done.

> Keeping the same indentation might be better.

The autovacuum line looks mis-indented in the patch file. However, I
now ran src/tools/pgindent/perltidyrc
src/test/recovery/t/041_wal_source_switch.pl on it.

Please see the attached v19 patch.

--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

---

From: Japin Li <[email-masked]>
Date: Tue, 20 Feb 2024 14:24:49 +0800

> src/test/recovery/t/041_wal_source_switch.pl on it.

Thanks for updating the patch.  It seems still with the wrong indent.

diff --git a/src/test/recovery/t/041_wal_source_switch.pl b/src/test/recovery/t/041_wal_source_switch.pl
index 082680bf4a..b5eddba1d5 100644
--- a/src/test/recovery/t/041_wal_source_switch.pl
+++ b/src/test/recovery/t/041_wal_source_switch.pl
@@ -18,9 +18,9 @@ $primary->init(
 # Ensure checkpoint doesn't come in our way
 $primary->append_conf(
 	'postgresql.conf', qq(
-    min_wal_size = 2MB
-    max_wal_size = 1GB
-    checkpoint_timeout = 1h
+	min_wal_size = 2MB
+	max_wal_size = 1GB
+	checkpoint_timeout = 1h
 	autovacuum = off
 ));
 $primary->start;
@@ -85,7 +85,7 @@ my $offset = -s $standby->logfile;
 my $apply_delay = $retry_interval * 5;
 $standby->append_conf(
 	'postgresql.conf', qq(
-recovery_min_apply_delay = '${apply_delay}ms'
+	recovery_min_apply_delay = '${apply_delay}ms'
 ));
 $standby->start;