| From: | Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> |
|---|---|
| To: | Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> |
| Cc: | Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Daniel Gustafsson <daniel(at)yesql(dot)se>, pgsql-bugs(at)lists(dot)postgresql(dot)org |
| Subject: | Re: autovacuum: automatically propagate updated parameters |
| Date: | 2026-08-27 00:07:52 |
| Message-ID: | CAD21AoDtpTY+0h3kSSsnsirVNRMVsKdfurkcLbbYAtwk8Fn24w@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
On Tue, Aug 25, 2026 at 4:17 AM Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> wrote:
>
> I attached v2 which moves the test case and removes the last part.
Thank you for the report and making the patch.
The fix looks good to me. As for the regression tests, since we don't
stop the second av worker, the first av worker needs to resume and
update its cost limit before the second worker finishes:
+# Second worker -> balance = 2
+$node->safe_psql('regress_db2',
+ 'ALTER TABLE filler SET (autovacuum_enabled = true)');
+$node->wait_for_log(
+ qr/VacuumUpdateCosts\(db=$db2oid, rel=$filleroid, dobalance=yes,
cost_limit=250,/,
+ $log_offset);
+
+$node->safe_psql('postgres',
+ "SELECT injection_points_wakeup('autovacuum-start-parallel-vacuum')");
+$node->safe_psql('postgres',
+ "SELECT injection_points_detach('autovacuum-start-parallel-vacuum')");
+
+# First param load must show the rebalanced limit.
+$node->wait_for_log(
+ qr/parallel autovacuum worker updated cost params: cost_limit=\d+,/,
+ $log_offset);
+my $log = slurp_file($node->logfile, $log_offset);
+my @limits =
+ $log =~ /parallel autovacuum worker updated cost params: cost_limit=(\d+),/g;
+note("parallel worker cost_limit sequence: @limits");
+is($limits[0], '250', 'parallel workers see the rebalanced cost limit');
Which seems to be unstable to me. In order to ensure that the second
worker lives when the first worker resumes its job, we can stop the
second worker at the injection point "vacuum-truncate-enabled" for
example. While it works and we can reduce the filler table size, it
would add an unclear dependency as vacuum-truncate-enabled is not
related to parallel autovacuum.
Regards,
--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Andrey Borodin | 2026-08-27 06:56:44 | Re: Possible G2-item at SERIALIZABLE |
| Previous Message | Alexander Korotkov | 2026-08-26 23:39:10 | Re: MERGE/SPLIT PARTITIONS issues/questions |