pgsql: Change LogicalTapeSetBlocks() to use nBlocksWritten.

From: Jeff Davis <jdavis(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Change LogicalTapeSetBlocks() to use nBlocksWritten.
Date: 2020-09-16 04:47:00
Message-ID: E1kIPLQ-0001Ne-K2@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Change LogicalTapeSetBlocks() to use nBlocksWritten.

Previously, it was based on nBlocksAllocated to account for tapes with
open write buffers that may not have made it to the BufFile yet.

That was unnecessary, because callers do not need to get the number of
blocks while a tape has an open write buffer; and it also conflicted
with the preallocation logic added for HashAgg.

Reviewed-by: Peter Geoghegan
Discussion: https://postgr.es/m/ce5af05900fdbd0e9185747825a7423c48501964.camel@j-davis.com
Backpatch-through: 13

Branch
------
master

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

Modified Files
--------------
src/backend/executor/nodeAgg.c | 2 +-
src/backend/utils/sort/logtape.c | 12 +++++++++++-
2 files changed, 12 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Jeff Davis 2020-09-16 04:51:26 pgsql: Change LogicalTapeSetBlocks() to use nBlocksWritten.
Previous Message Jeff Davis 2020-09-16 04:32:50 pgsql: HashAgg: release write buffers sooner by rewinding tape.