pgsql: Avoid division-by-zero when calculating autovacuum MXID score.

From: Nathan Bossart <nathan(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Avoid division-by-zero when calculating autovacuum MXID score.
Date: 2026-06-18 15:19:59
Message-ID: E1waEX8-000sk1-3C@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Avoid division-by-zero when calculating autovacuum MXID score.

In some cases, effective_multixact_freeze_max_age can be 0, which
presents a division-by-zero hazard for the multixact ID age score
calculation. To fix, bump it to 1 in that case so that we use the
multixact ID age as the score. While at it, also document that
this component score scales due to high multixact member space
usage.

Reported-by: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Author: Sami Imseih <samimseih(at)gmail(dot)com>
Reviewed-by: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAD21AoC6nKeYAjTvJ9dmBea03GZK9222h_O%3DONmcVuxfyO88Bg%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1f2297b548794a0fec502a9fc70c9970d96b09c4

Modified Files
--------------
doc/src/sgml/maintenance.sgml | 6 ++++--
src/backend/postmaster/autovacuum.c | 11 ++++++++---
2 files changed, 12 insertions(+), 5 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2026-06-18 16:19:38 pgsql: doc PG 19 relnotes: fix "standard_conforming_strings = off text
Previous Message Nathan Bossart 2026-06-18 14:32:17 pgsql: doc: Fix "Prev" link, take 2.