From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Extend the BufFile interface.
Date: Wed, 26 Aug 2020 02:59:57 +0000
Message-ID: <E1kAlfJ-00086o-Nx@gemulon.postgresql.org> (raw)
Extend the BufFile interface.
Allow BufFile to support temporary files that can be used by the single
backend when the corresponding files need to be survived across the
transaction and need to be opened and closed multiple times. Such files
need to be created as a member of a SharedFileSet.
Additionally, this commit implements the interface for BufFileTruncate to
allow files to be truncated up to a particular offset and extends the
BufFileSeek API to support the SEEK_END case. This also adds an option to
provide a mode while opening the shared BufFiles instead of always opening
in read-only mode.
These enhancements in BufFile interface are required for the upcoming
patch to allow the replication apply worker, to handle streamed
in-progress transactions.
Author: Dilip Kumar, Amit Kapila
Reviewed-by: Amit Kapila
Tested-by: Neha Sharma
Discussion: https://postgr.es/m/688b0b7f-2f6c-d827-c27b-216a8e3ea700@2ndquadrant.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/808e13b282efa7e7ac7b78e886aca5684f4bccd3
Modified Files
--------------
doc/src/sgml/monitoring.sgml | 4 +
src/backend/postmaster/pgstat.c | 3 +
src/backend/storage/file/buffile.c | 129 +++++++++++++++++++++++++++---
src/backend/storage/file/fd.c | 9 +--
src/backend/storage/file/sharedfileset.c | 105 ++++++++++++++++++++++--
src/backend/utils/sort/logtape.c | 4 +-
src/backend/utils/sort/sharedtuplestore.c | 2 +-
src/include/pgstat.h | 1 +
src/include/storage/buffile.h | 4 +-
src/include/storage/fd.h | 2 +-
src/include/storage/sharedfileset.h | 4 +-
11 files changed, 239 insertions(+), 28 deletions(-)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: akapila@postgresql.org
Subject: Re: pgsql: Extend the BufFile interface.
In-Reply-To: <E1kAlfJ-00086o-Nx@gemulon.postgresql.org>
References: <E1kAlfJ-00086o-Nx@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