=== Applying patches on top of PostgreSQL commit ID e18b0cb7344cb4bd28468f6c0aeeb9b9241d30aa === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Wed Jun 10 16:59:25 UTC 2026 On branch cf/5755 nothing to commit, working tree clean === using 'git am' to apply patch ./v37-0001-Allow-autovacuum-to-use-parallel-vacuum-workers.patch === Applying: Allow autovacuum to use parallel vacuum workers. Using index info to reconstruct a base tree... M doc/src/sgml/config.sgml M doc/src/sgml/maintenance.sgml M doc/src/sgml/ref/create_table.sgml M doc/src/sgml/ref/vacuum.sgml M src/backend/access/common/reloptions.c M src/backend/access/heap/vacuumlazy.c M src/backend/commands/vacuum.c M src/backend/commands/vacuumparallel.c M src/backend/postmaster/autovacuum.c M src/backend/utils/init/globals.c M src/backend/utils/misc/guc.c M src/backend/utils/misc/guc_parameters.dat M src/backend/utils/misc/postgresql.conf.sample M src/bin/psql/tab-complete.in.c M src/include/commands/vacuum.h M src/include/miscadmin.h M src/include/utils/rel.h M src/test/modules/Makefile M src/test/modules/meson.build M src/tools/pgindent/typedefs.list Falling back to patching base and 3-way merge... Auto-merging src/tools/pgindent/typedefs.list CONFLICT (content): Merge conflict in src/tools/pgindent/typedefs.list CONFLICT (add/add): Merge conflict in src/test/modules/test_autovacuum/t/001_parallel_autovacuum.pl Auto-merging src/test/modules/test_autovacuum/t/001_parallel_autovacuum.pl Auto-merging src/test/modules/meson.build Auto-merging src/test/modules/Makefile Auto-merging src/include/utils/rel.h Auto-merging src/include/miscadmin.h Auto-merging src/include/commands/vacuum.h Auto-merging src/bin/psql/tab-complete.in.c Auto-merging src/backend/utils/misc/postgresql.conf.sample Auto-merging src/backend/utils/misc/guc_parameters.dat Auto-merging src/backend/utils/misc/guc.c Auto-merging src/backend/utils/init/globals.c Auto-merging src/backend/postmaster/autovacuum.c Auto-merging src/backend/commands/vacuumparallel.c CONFLICT (content): Merge conflict in src/backend/commands/vacuumparallel.c Auto-merging src/backend/commands/vacuum.c Auto-merging doc/src/sgml/maintenance.sgml CONFLICT (content): Merge conflict in doc/src/sgml/maintenance.sgml Auto-merging doc/src/sgml/config.sgml error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 Allow autovacuum to use parallel vacuum workers. When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". === using patch(1) to apply patch ./v37-0001-Allow-autovacuum-to-use-parallel-vacuum-workers.patch === patching file doc/src/sgml/config.sgml Hunk #1 FAILED at 2918. Hunk #2 succeeded at 9253 with fuzz 2 (offset -233 lines). 1 out of 2 hunks FAILED -- saving rejects to file doc/src/sgml/config.sgml.rej patching file doc/src/sgml/maintenance.sgml Hunk #1 FAILED at 1038. Hunk #2 succeeded at 1206 with fuzz 2 (offset 40 lines). 1 out of 2 hunks FAILED -- saving rejects to file doc/src/sgml/maintenance.sgml.rej patching file doc/src/sgml/ref/create_table.sgml Hunk #1 succeeded at 1754 (offset 16 lines). patching file doc/src/sgml/ref/vacuum.sgml Hunk #1 FAILED at 81. Hunk #2 FAILED at 266. 2 out of 2 hunks FAILED -- saving rejects to file doc/src/sgml/ref/vacuum.sgml.rej patching file src/backend/access/common/reloptions.c Hunk #1 succeeded at 236 with fuzz 1. Hunk #2 FAILED at 1978. 1 out of 2 hunks FAILED -- saving rejects to file src/backend/access/common/reloptions.c.rej patching file src/backend/access/heap/vacuumlazy.c Hunk #1 FAILED at 152. Hunk #2 succeeded at 865 with fuzz 2 (offset 3 lines). 1 out of 2 hunks FAILED -- saving rejects to file src/backend/access/heap/vacuumlazy.c.rej patching file src/backend/commands/vacuum.c Hunk #1 FAILED at 2435. Hunk #2 FAILED at 2450. 2 out of 2 hunks FAILED -- saving rejects to file src/backend/commands/vacuum.c.rej patching file src/backend/commands/vacuumparallel.c Hunk #1 FAILED at 1. Hunk #2 succeeded at 25 with fuzz 2 (offset 9 lines). Hunk #3 succeeded at 67 with fuzz 2 (offset 9 lines). Hunk #4 FAILED at 154. Hunk #5 succeeded at 315 with fuzz 2 (offset 59 lines). Hunk #6 FAILED at 278. Hunk #7 FAILED at 419. Hunk #8 succeeded at 515 with fuzz 2 (offset 78 lines). Hunk #9 succeeded at 599 with fuzz 2 (offset 81 lines). Hunk #10 succeeded at 802 with fuzz 1 (offset 191 lines). Hunk #11 FAILED at 729. Hunk #12 FAILED at 773. Hunk #13 FAILED at 1238. Hunk #14 FAILED at 1293. 8 out of 14 hunks FAILED -- saving rejects to file src/backend/commands/vacuumparallel.c.rej patching file src/backend/postmaster/autovacuum.c Hunk #1 FAILED at 1689. Hunk #2 FAILED at 2931. Hunk #3 succeeded at 2958 with fuzz 2 (offset 16 lines). 2 out of 3 hunks FAILED -- saving rejects to file src/backend/postmaster/autovacuum.c.rej patching file src/backend/utils/init/globals.c Hunk #1 FAILED at 143. 1 out of 1 hunk FAILED -- saving rejects to file src/backend/utils/init/globals.c.rej patching file src/backend/utils/misc/guc.c Hunk #1 FAILED at 3358. 1 out of 1 hunk FAILED -- saving rejects to file src/backend/utils/misc/guc.c.rej patching file src/backend/utils/misc/guc_parameters.dat Hunk #1 succeeded at 178 with fuzz 1 (offset 8 lines). patching file src/backend/utils/misc/postgresql.conf.sample Hunk #1 FAILED at 713. 1 out of 1 hunk FAILED -- saving rejects to file src/backend/utils/misc/postgresql.conf.sample.rej patching file src/bin/psql/tab-complete.in.c Hunk #1 FAILED at 1432. 1 out of 1 hunk FAILED -- saving rejects to file src/bin/psql/tab-complete.in.c.rej patching file src/include/commands/vacuum.h Hunk #1 FAILED at 422. 1 out of 1 hunk FAILED -- saving rejects to file src/include/commands/vacuum.h.rej patching file src/include/miscadmin.h Hunk #1 FAILED at 178. 1 out of 1 hunk FAILED -- saving rejects to file src/include/miscadmin.h.rej patching file src/include/utils/rel.h Hunk #1 FAILED at 311. 1 out of 1 hunk FAILED -- saving rejects to file src/include/utils/rel.h.rej patching file src/test/modules/Makefile Hunk #1 FAILED at 16. 1 out of 1 hunk FAILED -- saving rejects to file src/test/modules/Makefile.rej patching file src/test/modules/meson.build Hunk #1 FAILED at 16. 1 out of 1 hunk FAILED -- saving rejects to file src/test/modules/meson.build.rej The next patch would create the file src/test/modules/test_autovacuum/.gitignore, which already exists! Skipping patch. 1 out of 1 hunk ignored The next patch would create the file src/test/modules/test_autovacuum/Makefile, which already exists! Skipping patch. 1 out of 1 hunk ignored The next patch would create the file src/test/modules/test_autovacuum/meson.build, which already exists! Skipping patch. 1 out of 1 hunk ignored The next patch would create the file src/test/modules/test_autovacuum/t/001_parallel_autovacuum.pl, which already exists! Skipping patch. 1 out of 1 hunk ignored patching file src/tools/pgindent/typedefs.list Hunk #1 FAILED at 2109. 1 out of 1 hunk FAILED -- saving rejects to file src/tools/pgindent/typedefs.list.rej Unstaged changes after reset: M doc/src/sgml/config.sgml M doc/src/sgml/maintenance.sgml M doc/src/sgml/ref/create_table.sgml M src/backend/access/common/reloptions.c M src/backend/access/heap/vacuumlazy.c M src/backend/commands/vacuumparallel.c M src/backend/postmaster/autovacuum.c M src/backend/utils/misc/guc_parameters.dat Removing doc/src/sgml/config.sgml.rej Removing doc/src/sgml/maintenance.sgml.rej Removing doc/src/sgml/ref/vacuum.sgml.rej Removing src/backend/access/common/reloptions.c.rej Removing src/backend/access/heap/vacuumlazy.c.rej Removing src/backend/commands/vacuum.c.rej Removing src/backend/commands/vacuumparallel.c.rej Removing src/backend/postmaster/autovacuum.c.rej Removing src/backend/utils/init/globals.c.rej Removing src/backend/utils/misc/guc.c.rej Removing src/backend/utils/misc/postgresql.conf.sample.rej Removing src/bin/psql/tab-complete.in.c.rej Removing src/include/commands/vacuum.h.rej Removing src/include/miscadmin.h.rej Removing src/include/utils/rel.h.rej Removing src/test/modules/Makefile.rej Removing src/test/modules/meson.build.rej Removing src/tools/pgindent/typedefs.list.rej === using 'git apply' to apply patch ./v37-0001-Allow-autovacuum-to-use-parallel-vacuum-workers.patch === Applied patch to 'doc/src/sgml/config.sgml' cleanly. Applied patch to 'doc/src/sgml/maintenance.sgml' with conflicts. Applied patch to 'doc/src/sgml/ref/create_table.sgml' cleanly. Applied patch to 'doc/src/sgml/ref/vacuum.sgml' cleanly. Applied patch to 'src/backend/access/common/reloptions.c' cleanly. Applied patch to 'src/backend/access/heap/vacuumlazy.c' cleanly. Applied patch to 'src/backend/commands/vacuum.c' cleanly. Applied patch to 'src/backend/commands/vacuumparallel.c' with conflicts. Applied patch to 'src/backend/postmaster/autovacuum.c' cleanly. Applied patch to 'src/backend/utils/init/globals.c' cleanly. Applied patch to 'src/backend/utils/misc/guc.c' cleanly. Applied patch to 'src/backend/utils/misc/guc_parameters.dat' cleanly. Applied patch to 'src/backend/utils/misc/postgresql.conf.sample' cleanly. Applied patch to 'src/bin/psql/tab-complete.in.c' cleanly. Applied patch to 'src/include/commands/vacuum.h' cleanly. Applied patch to 'src/include/miscadmin.h' cleanly. Applied patch to 'src/include/utils/rel.h' cleanly. Applied patch to 'src/test/modules/Makefile' cleanly. Applied patch to 'src/test/modules/meson.build' cleanly. Performing three-way merge... Applied patch to 'src/test/modules/test_autovacuum/.gitignore' cleanly. Performing three-way merge... Applied patch to 'src/test/modules/test_autovacuum/Makefile' cleanly. Performing three-way merge... Applied patch to 'src/test/modules/test_autovacuum/meson.build' cleanly. Performing three-way merge... Applied patch to 'src/test/modules/test_autovacuum/t/001_parallel_autovacuum.pl' with conflicts. Applied patch to 'src/tools/pgindent/typedefs.list' with conflicts. U doc/src/sgml/maintenance.sgml U src/backend/commands/vacuumparallel.c U src/test/modules/test_autovacuum/t/001_parallel_autovacuum.pl U src/tools/pgindent/typedefs.list diff --cc doc/src/sgml/maintenance.sgml index 4a21bdb5de7,64bbc831343..00000000000 --- a/doc/src/sgml/maintenance.sgml +++ b/doc/src/sgml/maintenance.sgml @@@ -1186,15 -1180,15 +1186,27 @@@ analyze threshold = analyze base thresh vacuum phase, please refer to ). The degree of parallelism is determined by the number of indexes on the relation that support parallel vacuum. For manual VACUUM, ++<<<<<<< ours + this is limited by the PARALLEL option if specified, + which is further capped by . + For autovacuum, it is limited by the table's + if specified, + which is further capped by + parameter. Please note that it is not guaranteed that the number of parallel + workers that was calculated will be used during execution. It is possible for + a vacuum to run with fewer workers than specified, or even with no workers at + all. ++======= + this is limited by the PARALLEL option, which is + further capped by . + For autovacuum, it is limited by the table's + if any which is + capped limited by + parameter. Please + note that it is not guaranteed that the number of parallel workers that was + calculated will be used during execution. It is possible for a vacuum to + run with fewer workers than specified, or even with no workers at all. ++>>>>>>> theirs diff --cc src/backend/commands/vacuumparallel.c index 41cefcfde54,979c2be4abd..00000000000 --- a/src/backend/commands/vacuumparallel.c +++ b/src/backend/commands/vacuumparallel.c @@@ -545,7 -545,7 +545,11 @@@ parallel_vacuum_end(ParallelVacuumStat /* * DSM detach callback. This is invoked when an autovacuum worker detaches * from the DSM segment holding PVShared. It ensures to reset the local pointer ++<<<<<<< ours + * to the shared state even if parallel vacuum raises an error and doesn't ++======= + * to the shared state even if paralell vacuum raises an error and doesn't ++>>>>>>> theirs * call parallel_vacuum_end(). */ static void diff --cc src/test/modules/test_autovacuum/t/001_parallel_autovacuum.pl index 22f40cb1d50,c5a2e78246a..00000000000 --- a/src/test/modules/test_autovacuum/t/001_parallel_autovacuum.pl +++ b/src/test/modules/test_autovacuum/t/001_parallel_autovacuum.pl @@@ -15,7 -15,8 +15,12 @@@ if ($ENV{enable_injection_points} ne 'y } # Before each test we should disable autovacuum for 'test_autovac' table and ++<<<<<<< ours +# generate some dead tuples in it. ++======= + # generate some dead tuples in it. Returns the current autovacuum_count of + # the table test_autovac. ++>>>>>>> theirs sub prepare_for_next_test { my ($node, $test_number) = @_; @@@ -25,6 -26,24 +30,27 @@@ ALTER TABLE test_autovac SET (autovacuum_enabled = false); UPDATE test_autovac SET col_1 = $test_number; }); ++<<<<<<< ours ++======= + + my $count = $node->safe_psql( + 'postgres', qq{ + SELECT autovacuum_count FROM pg_stat_user_tables WHERE relname = 'test_autovac' + }); + + return $count; + } + + # Wait for the table to be vacuumed by an autovacuum worker. + sub wait_for_autovacuum_complete + { + my ($node, $old_count) = @_; + + $node->poll_query_until( + 'postgres', qq{ + SELECT autovacuum_count > $old_count FROM pg_stat_user_tables WHERE relname = 'test_autovac' + }); ++>>>>>>> theirs } my $node = PostgreSQL::Test::Cluster->new('main'); @@@ -100,7 -119,7 +126,11 @@@ $node->safe_psql # Our table has enough indexes and appropriate reloptions, so autovacuum must # be able to process it in parallel mode. Just check if it can do it. ++<<<<<<< ours +prepare_for_next_test($node, 1); ++======= + my $av_count = prepare_for_next_test($node, 1); ++>>>>>>> theirs my $log_offset = -s $node->logfile; $node->safe_psql( @@@ -108,17 -127,18 +138,30 @@@ ALTER TABLE test_autovac SET (autovacuum_enabled = true); }); ++<<<<<<< ours +# Wait for parallel autovacuum to complete; check worker count matches reloptions. +$node->wait_for_log( + qr/parallel workers: index vacuum: 2 planned, 2 launched in total/, + $log_offset); +ok(1, "parallel autovacuum on test_autovac table"); ++======= + # Wait until the parallel autovacuum on table is completed. At the same time, + # we check that the required number of parallel workers has been started. + wait_for_autovacuum_complete($node, $av_count); + ok( $node->log_contains( + qr/parallel workers: index vacuum: 2 planned, 2 launched in total/, + $log_offset)); ++>>>>>>> theirs # Test 2: # Check whether parallel autovacuum leader can propagate cost-based parameters # to the parallel workers. ++<<<<<<< ours +prepare_for_next_test($node, 2); ++======= + $av_count = prepare_for_next_test($node, 2); ++>>>>>>> theirs $log_offset = -s $node->logfile; $node->safe_psql( @@@ -157,15 -177,13 +200,23 @@@ $node->wait_for_log qr/parallel autovacuum worker updated cost params: cost_limit=500, cost_delay=5, cost_page_miss=10, cost_page_dirty=10, cost_page_hit=10/, $log_offset); ++<<<<<<< ours ++======= + wait_for_autovacuum_complete($node, $av_count); + ++>>>>>>> theirs # Cleanup $node->safe_psql( 'postgres', qq{ SELECT injection_points_detach('autovacuum-start-parallel-vacuum'); }); ++<<<<<<< ours +ok(1, + "vacuum delay parameter changes are propagated to parallel vacuum workers" +); + ++======= ++>>>>>>> theirs $node->stop; done_testing(); diff --cc src/tools/pgindent/typedefs.list index 8cf40c87043,a64faa32682..00000000000 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@@ -2131,8 -2110,8 +2131,12 @@@ PVIndVacStatu PVOID PVShared PVSharedCostParams ++<<<<<<< ours ++======= + PVWorkerUsage ++>>>>>>> theirs PVWorkerStats +PVWorkerUsage PX_Alias PX_Cipher PX_Combo