Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Michael Paquier <michael@paquier.xyz>
Cc: Nathan Bossart <nathandbossart@gmail.com>, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, Thomas Munro <thomas.munro@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-10-30T14:44:32Z
Lists: pgsql-hackers
Attachments
- 0001-No-need-to-avoid-including-pg_iovec.h.patch (text/x-diff)
On 2022-Oct-27, Michael Paquier wrote: > On Thu, Sep 29, 2022 at 08:09:56PM -0700, Nathan Bossart wrote: > > Looks reasonable to me. > > 0001, to move pg_pwritev_with_retry() to a new home, seems fine, so > applied. Maybe something a bit useless, but while perusing the commits I noticed a forward struct declaration was moved from one file to another; this is claimed to avoid including port/pg_iovec.h in common/file_utils.h. We do that kind of thing in a few places, but in this particular case it seems a bit of a pointless exercise, since pg_iovec.h doesn't include anything else and it's a quite simple header. So I'm kinda proposing that we only do the forward struct initialization dance when it really saves on things -- in particular, when it helps avoid or reduce massive indirect header inclusion. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
Commits
-
Revise pg_pwrite_zeros()
- ce340e530d1f 16.0 landed
-
Use pg_pwrite_zeros() in walmethods.c
- 28cc2976a9cf 16.0 landed
-
Introduce pg_pwrite_zeros() in fileutils.c
- 3bdbdf5d06f2 16.0 landed
-
Move pg_pwritev_with_retry() to src/common/file_utils.c
- 4ab8c81bd90a 16.0 landed
-
Restore pg_pread and friends.
- b6d8a60aba32 16.0 landed
-
Remove dead pread and pwrite replacement code.
- cf112c122060 16.0 cited