v3-0003-change-the-log-level-of-sync-slot-test-to-debug2.patch

application/octet-stream

Filename: v3-0003-change-the-log-level-of-sync-slot-test-to-debug2.patch
Type: application/octet-stream
Part: 2
Message: RE: Synchronizing slots from primary to standby

Patch

Format: format-patch
Series: patch v3-0003
Subject: change the log level of sync slot test to debug2
File+
src/test/recovery/t/040_standby_failover_slots_sync.pl 14 0
From 10336debb27821470bcc488507bf0e3896abde08 Mon Sep 17 00:00:00 2001
From: Hou Zhijie <sherlockcpp@foxmail.com>
Date: Thu, 15 Feb 2024 22:56:31 +0800
Subject: [PATCH v3 3/3] change the log level of sync slot test to debug2

---
 .../recovery/t/040_standby_failover_slots_sync.pl  | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/test/recovery/t/040_standby_failover_slots_sync.pl b/src/test/recovery/t/040_standby_failover_slots_sync.pl
index 7ad5f2eb11..ac237fd8e2 100644
--- a/src/test/recovery/t/040_standby_failover_slots_sync.pl
+++ b/src/test/recovery/t/040_standby_failover_slots_sync.pl
@@ -130,14 +130,21 @@ $standby1->init_from_backup(
 	has_streaming => 1,
 	has_restoring => 1);
 
+# Increase the log_min_messages setting to DEBUG2 on both the standby and
+# primary. This will allow for more detailed information collection, which can
+# be valuable for analysis purposes.
 my $connstr_1 = $primary->connstr;
 $standby1->append_conf(
 	'postgresql.conf', qq(
 hot_standby_feedback = on
 primary_slot_name = 'sb1_slot'
 primary_conninfo = '$connstr_1 dbname=postgres'
+log_min_messages = 'debug2'
 ));
 
+$primary->append_conf('postgresql.conf', "log_min_messages = 'debug2'");
+$primary->reload;
+
 $primary->psql('postgres',
 	q{SELECT pg_create_logical_replication_slot('lsub2_slot', 'test_decoding', false, false, true);}
 );
@@ -265,6 +272,13 @@ is( $standby1->safe_psql(
 	"t",
 	'logical slot is re-synced');
 
+# Reset the log_min_messages to the default value.
+$primary->append_conf('postgresql.conf', "log_min_messages = 'warning'");
+$primary->reload;
+
+$standby1->append_conf('postgresql.conf', "log_min_messages = 'warning'");
+$standby1->reload;
+
 ##################################################
 # Test that a synchronized slot can not be decoded, altered or dropped by the
 # user
-- 
2.34.1