Re: logtape.c stats don't account for unused "prefetched" block numbers

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: logtape.c stats don't account for unused "prefetched" block numbers
Date: 2020-09-14 22:23:59
Message-ID: 20200914222359.GA6834@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-Sep-14, Peter Geoghegan wrote:

> On Fri, Sep 11, 2020 at 6:37 PM Peter Geoghegan <pg(at)bowt(dot)ie> wrote:
> > It would be awkward if we just used nBlocksWritten within
> > LogicalTapeSetBlocks() in the case where we didn't preallocate (or in
> > all cases). Not entirely sure what to do about that just yet.
>
> I guess that that's the logical thing to do, as in the attached patch.

I don't understand this patch. Or maybe I should say I don't understand
the code you're patching. Why isn't the correct answer *always*
nBlocksWritten? The comment in LogicalTapeSet says:

"nBlocksWritten is the size of the underlying file, in BLCKSZ blocks."

so if LogicalTapeSetBlocks wants to do what its comment says, that is,

"Obtain total disk space currently used by a LogicalTapeSet, in blocks."

then it seems like they're an exact match. Either that, or more than
zero of those comments are lying.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-09-14 22:28:09 Re: pg_restore causing deadlocks on partitioned tables
Previous Message Jeff Davis 2020-09-14 22:20:02 Re: logtape.c stats don't account for unused "prefetched" block numbers