pgsql: Fix BRIN 32-bit counter wrap issue with huge tables - Mailing list pgsql-committers

From David Rowley
Subject pgsql: Fix BRIN 32-bit counter wrap issue with huge tables
Date
Msg-id E1vB75d-002kSh-13@gemulon.postgresql.org
Whole thread Raw
List 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@gmail.com>
Reviewed-by: David Rowley <dgrowleyml@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/CAOG6S4-tGksTQhVzJM19NzLYAHusXsK2HmADPZzGQcfZABsvpA@mail.gmail.com
Backpatch-through: 13

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/c4f5a59ab16b6b0f799e0d63783826f684eb3f2c

Modified Files
--------------
src/backend/access/brin/brin.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)


pgsql-committers by date:

Previous
From: David Rowley
Date:
Subject: pgsql: Fix BRIN 32-bit counter wrap issue with huge tables
Next
From: David Rowley
Date:
Subject: pgsql: Fix BRIN 32-bit counter wrap issue with huge tables