pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Masahiko Sawada <msawada@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix the type of heap tuple count passed to parallel vacuum.
Date: Wed, 11 Nov 2026 18:38:48 +0000
Message-ID: <E1xRDDc-00000000LXN-14C8@gemulon.postgresql.org> (raw)

Fix the type of heap tuple count passed to parallel vacuum.

Commit 8e1fae19386 declared the heap tuple count passed to parallel
index bulk-deletion and cleanup as long, although the callers pass a
double and it's stored as a double for the index AMs. On platforms
where long is 32 bits, such as Windows, a count above LONG_MAX doesn't
fit, so the index AMs could get a bogus num_heap_tuples when vacuuming
in parallel. In the cleanup phase, this could lead to wrong index
statistics.

Fix by declaring it as double.

The bug exists since v15, but changing the function signatures would
break ABI in released branches, so backpatch to v19 only.

Author: Baji Shaik <baji.pgdev@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Discussion: https://postgr.es/m/CA+fm-ROT7pH2oBrp=hOJfh8ux+UO0Y0vRk7xD_wcdRVVqWrs+g@mail.gmail.com
Backpatch-through: 19

Branch
------
REL_19_STABLE

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

Modified Files
--------------
src/backend/commands/vacuumparallel.c | 4 ++--
src/include/commands/vacuum.h         | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)



view thread (2+ messages)

Message-ID: <E1xRDDc-00000000LXN-14C8@gemulon.postgresql.org>
Permalink:  ../E1xRDDc-00000000LXN-14C8@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xRDDc-00000000LXN-14C8@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: msawada@postgresql.org
  Subject: Re: pgsql: Fix the type of heap tuple count passed to parallel vacuum.
  In-Reply-To: <E1xRDDc-00000000LXN-14C8@gemulon.postgresql.org>
  References: <E1xRDDc-00000000LXN-14C8@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox