| From: | David Rowley <drowley(at)postgresql(dot)org> | 
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org | 
| Subject: | pgsql: Fix BRIN 32-bit counter wrap issue with huge tables | 
| Date: | 2025-10-21 07:46:38 | 
| Message-ID: | E1vB74o-002kPN-11@gemulon.postgresql.org | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-committers | 
Fix BRIN 32-bit counter wrap issue with huge tables
A BlockNumber (32-bit) might not be large enough to add bo_pagesPerRange
to when the table contains close to 2^32 pages.  At worst, this could
result in a cancellable infinite loop during the BRIN index scan with
power-of-2 pagesPerRange, and slow (inefficient) BRIN index scans and
scanning of unneeded heap blocks for non power-of-2 pagesPerRange.
Backpatch to all supported versions.
Author: sunil s <sunilfeb26(at)gmail(dot)com>
Reviewed-by: David Rowley <dgrowleyml(at)gmail(dot)com>
Reviewed-by: Michael Paquier <michael(at)paquier(dot)xyz>
Discussion: https://postgr.es/m/CAOG6S4-tGksTQhVzJM19NzLYAHusXsK2HmADPZzGQcfZABsvpA@mail.gmail.com
Backpatch-through: 13
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/9fd29d7ff476f3f1c1a22d6d6f730e813eddd960
Modified Files
--------------
src/backend/access/brin/brin.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | David Rowley | 2025-10-21 07:47:04 | pgsql: Fix BRIN 32-bit counter wrap issue with huge tables | 
| Previous Message | Michael Paquier | 2025-10-21 07:12:54 | pgsql: Fix comment in pg_get_shmem_allocations_numa() |