Re: pg_amcheck contrib application - Mailing list pgsql-hackers

From Robert Haas
Subject Re: pg_amcheck contrib application
Date
Msg-id CA+TgmoapGYVYzb9nctO9+znsSafcsHBAf6bb2x_px8pT4aZe=A@mail.gmail.com
Whole thread Raw
In response to Re: pg_amcheck contrib application  (Mark Dilger <mark.dilger@enterprisedb.com>)
Responses Re: pg_amcheck contrib application
List pgsql-hackers
On Fri, Apr 23, 2021 at 2:36 PM Mark Dilger
<mark.dilger@enterprisedb.com> wrote:
> > What's different?
>
> for one thing, if a sequence of chunks happens to fit perfectly, the final chunk will have size TOAST_MAX_CHUNK_SIZE,
butyou're expecting no larger than one less than that, given how modulo arithmetic works.
 

Good point.

Perhaps something like this, closer to the way you had it?

       expected_size = chunk_seq < last_chunk_seq ? TOAST_MAX_CHUNK_SIZE
               : extsize - (last_chunk_seq * TOAST_MAX_CHUNK_SIZE);

-- 
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: decoupling table and index vacuum
Next
From: Andres Freund
Date:
Subject: Testing autovacuum wraparound (including failsafe)