Test patch: Enable summarize_wal by default. walsummarizer2
authorRobert Haas <rhaas@postgresql.org>
Tue, 14 Nov 2023 18:49:28 +0000 (13:49 -0500)
committerRobert Haas <rhaas@postgresql.org>
Thu, 30 Nov 2023 14:10:48 +0000 (09:10 -0500)
To avoid test failures, must remove the prohibition against running
summarize_wal=off with wal_level=minimal, because a bunch of tests
run with wal_level=minimal.

Not for commit.

src/backend/postmaster/postmaster.c
src/backend/postmaster/walsummarizer.c
src/backend/utils/misc/guc_tables.c
src/test/recovery/t/001_stream_rep.pl
src/test/recovery/t/019_replslot_limit.pl
src/test/recovery/t/020_archive_status.pl
src/test/recovery/t/035_standby_logical_decoding.pl

index 1d52a2db7c4d157868a860f45543f76c7155ca13..37c711230b32f7c08f7dc56bc09de9e428f0216f 100644 (file)
@@ -935,9 +935,6 @@ PostmasterMain(int argc, char *argv[])
        if (max_wal_senders > 0 && wal_level == WAL_LEVEL_MINIMAL)
                ereport(ERROR,
                                (errmsg("WAL streaming (max_wal_senders > 0) requires wal_level \"replica\" or \"logical\"")));
-       if (summarize_wal && wal_level == WAL_LEVEL_MINIMAL)
-               ereport(ERROR,
-                               (errmsg("WAL cannot be summarized when wal_level is \"minimal\"")));
 
        /*
         * Other one-time internal sanity checks can go here, if they are fast.
index 7966755f226b855c43d3c676c60fc1b15d0d7b23..74a0116a136315fefabfa36f0211dfd0f8453748 100644 (file)
@@ -139,7 +139,7 @@ static XLogRecPtr redo_pointer_at_last_summary_removal = InvalidXLogRecPtr;
 /*
  * GUC parameters
  */
-bool           summarize_wal = false;
+bool           summarize_wal = true;
 int                    wal_summary_keep_time = 10 * 24 * 60;
 
 static XLogRecPtr GetLatestLSN(TimeLineID *tli);
index 405c422db7975f7b22bf1f494868ed00891d2288..d18f93d3c8804b6d342e066899e416881add30a0 100644 (file)
@@ -1796,7 +1796,7 @@ struct config_bool ConfigureNamesBool[] =
                        NULL
                },
                &summarize_wal,
-               false,
+               true,
                NULL, NULL, NULL
        },
 
index 95f9b0d7726fb5f0278d1ad0d3e7c5ac5d431e76..0d0e63b8dc96c2c1fc532b195bd0fe76555dc6d3 100644 (file)
@@ -15,6 +15,8 @@ my $node_primary = PostgreSQL::Test::Cluster->new('primary');
 $node_primary->init(
        allows_streaming => 1,
        auth_extra => [ '--create-role', 'repl_role' ]);
+# WAL summarization can postpone WAL recycling, leading to test failures
+$node_primary->append_conf('postgresql.conf', "summarize_wal = off");
 $node_primary->start;
 my $backup_name = 'my_backup';
 
index 7d94f157780a9fd27880f4567c1db988522ce252..a8b342bb98ac2cc442f9778b4204229a98696e13 100644 (file)
@@ -22,6 +22,7 @@ $node_primary->append_conf(
 min_wal_size = 2MB
 max_wal_size = 4MB
 log_checkpoints = yes
+summarize_wal = off
 ));
 $node_primary->start;
 $node_primary->safe_psql('postgres',
@@ -256,6 +257,7 @@ $node_primary2->append_conf(
 min_wal_size = 32MB
 max_wal_size = 32MB
 log_checkpoints = yes
+summarize_wal = off
 ));
 $node_primary2->start;
 $node_primary2->safe_psql('postgres',
@@ -310,6 +312,7 @@ $node_primary3->append_conf(
        max_wal_size = 2MB
        log_checkpoints = yes
        max_slot_wal_keep_size = 1MB
+    summarize_wal = off
        ));
 $node_primary3->start;
 $node_primary3->safe_psql('postgres',
index fa24153d4b98bd6d7409f4d0aa17cf77f5b75df2..d0d622136893f1f8b5af2a3ee01257bb65df26ba 100644 (file)
@@ -15,6 +15,7 @@ $primary->init(
        has_archiving => 1,
        allows_streaming => 1);
 $primary->append_conf('postgresql.conf', 'autovacuum = off');
+$primary->append_conf('postgresql.conf', 'summarize_wal = off');
 $primary->start;
 my $primary_data = $primary->data_dir;
 
index 9c34c0d36cbfc1f018f3c546cb991f51add1b598..482edc57a8cb8bbe974be97eba6361eaf1592386 100644 (file)
@@ -250,6 +250,7 @@ $node_primary->append_conf(
 wal_level = 'logical'
 max_replication_slots = 4
 max_wal_senders = 4
+summarize_wal = off
 });
 $node_primary->dump_info;
 $node_primary->start;