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 <[email protected]> Reviewed-by: David Rowley <[email protected]> Reviewed-by: Michael Paquier <[email protected]> Discussion: https://postgr.es/m/caog6s4-tgkstqhvzjm19nzlyahusxsk2hmadpzzgqcfzabs...@mail.gmail.com Backpatch-through: 13 Branch ------ REL_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/715983a81ac85a2d78ba1e2a7fe00bcf62f4ad3c Modified Files -------------- src/backend/access/brin/brin.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
