pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix incorrect calculation in BlockRefTableEntryGetBlocks.
Date: Fri, 05 Apr 2024 17:50:41 +0000
Message-ID: <E1rsni5-000fUn-Ae@gemulon.postgresql.org> (raw)

Fix incorrect calculation in BlockRefTableEntryGetBlocks.

The previous formula was incorrect in the case where the function's
nblocks argument was a multiple of BLOCKS_PER_CHUNK, which happens
whenever a relation segment file is exactly 512MB or exactly 1GB in
length. In such cases, the formula would calculate a stop_offset of
0 rather than 65536, resulting in modified blocks in the second half
of a 1GB file, or all the modified blocks in a 512MB file, being
omitted from the incremental backup.

Reported off-list by Tomas Vondra and Jakub Wartak.

Discussion: http://postgr.es/m/CA+TgmoYwy_KHp1-5GYNmVa=zdeJWhNH1T0SBmEuvqQNJEHj1Lw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/55a5ee30cd65886ff0a2e7ffef4ec2816fbec273

Modified Files
--------------
src/common/blkreftable.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)



Message-ID: <E1rsni5-000fUn-Ae@gemulon.postgresql.org>
Permalink:  ../E1rsni5-000fUn-Ae@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rsni5-000fUn-Ae@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: rhaas@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix incorrect calculation in BlockRefTableEntryGetBlocks.
  In-Reply-To: <E1rsni5-000fUn-Ae@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