From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Introduce pg_pwrite_zeros() in fileutils.c
Date: Tue, 08 Nov 2022 03:24:24 +0000
Message-ID: <E1osFDr-0006y4-3l@gemulon.postgresql.org> (raw)
Introduce pg_pwrite_zeros() in fileutils.c
This routine is designed to write zeros to a file using vectored I/O,
for a size given by its caller, being useful when it comes to
initializing a file with a final size already known.
XLogFileInitInternal() in xlog.c is changed to use this new routine when
initializing WAL segments with zeros (wal_init_zero enabled). Note that
the aligned buffers used for the vectored I/O writes have a size of
XLOG_BLCKSZ, and not BLCKSZ anymore, as pg_pwrite_zeros() relies on
PGAlignedBlock while xlog.c originally used PGAlignedXLogBlock.
This routine will be used in a follow-up patch to do the pre-padding of
WAL segments for pg_receivewal and pg_basebackup when these are not
compressed.
Author: Bharath Rupireddy
Reviewed-by: Nathan Bossart, Andres Freund, Thomas Munro, Michael
Paquier
Discussion: https://www.postgresql.org/message-id/CALj2ACUq7nAb7%3DbJNbK3yYmp-SZhJcXFR_pLk8un6XgDzDF3OA%40mail.g...
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/3bdbdf5d06f2179d4c17926d77ff734ea9e7d525
Modified Files
--------------
src/backend/access/transam/xlog.c | 33 +++---------------
src/common/file_utils.c | 73 +++++++++++++++++++++++++++++++++++++++
src/include/common/file_utils.h | 2 ++
3 files changed, 80 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: michael@paquier.xyz
Subject: Re: pgsql: Introduce pg_pwrite_zeros() in fileutils.c
In-Reply-To: <E1osFDr-0006y4-3l@gemulon.postgresql.org>
References: <E1osFDr-0006y4-3l@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