Re: another autovacuum scheduling thread - Mailing list pgsql-hackers

From Sami Imseih
Subject Re: another autovacuum scheduling thread
Date
Msg-id CAA5RZ0s7k6yve1Bq1OY+aXU3ifc_fvOiYkpE2VxwrUcHr2AtTg@mail.gmail.com
Whole thread
In response to Re: another autovacuum scheduling thread  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: another autovacuum scheduling thread
List pgsql-hackers
> Done in the attached.

Thanks!

I have a few comments.

#1.
+ * between 0.0 and 1.0 (inclusive).  Setting all of these to 0.0 restores

This should be "0.0 and 10.0"

#2.
typo:

+                * being scaling aggressively.

Thisshould be "begin"

#3.
This reads more like documentation than code comment.

+ * To adjust how strongly each component contributes to the score, the
+ * following parameters can be adjusted from their default of 1.0 to anywhere
+ * between 0.0 and 1.0 (inclusive).  Setting all of these to 0.0 restores
+ * pre-v19 prioritization behavior:
+ *
+ *     autovacuum_freeze_score_weight
+ *     autovacuum_multixact_freeze_score_weight
+ *     autovacuum_vacuum_score_weight
+ *     autovacuum_vacuum_insert_score_weight
+ *     autovacuum_analyze_score_weight

I don't actually think this section adds any value at all to the comments.

#4.
+                       elog(DEBUG3, "%s: vac: %.0f (threshold %.0f),
ins: (disabled), anl: %.0f (threshold %.0f), score %.3f",

A missing colon after "score", unlike the other occurrence which has it.

#5.
+               if (autovacuum_freeze_score_weight > 1.0)
+                       effective_xid_failsafe_age /=
autovacuum_freeze_score_weight;
+               if (autovacuum_multixact_freeze_score_weight > 1.0)
+                       effective_mxid_failsafe_age /=
autovacuum_multixact_freeze_score_weight;
+

Shouldn't this be "if (autovacuum_freeze_score_weight > 0.0)" ?
A weight > 0 should always adjust the threshold, right? we should only
prevent division by 0 here.

--
Sami Imseih
Amazon Web Services (AWS)



pgsql-hackers by date:

Previous
From: Peter Smith
Date:
Subject: Re: Fix how some lists are displayed by psql \d+
Next
From: David Rowley
Date:
Subject: Re: another autovacuum scheduling thread