On Sat, Sep 24, 2022 at 1:54 AM Nathan Bossart <nathandboss...@gmail.com> wrote: > > + PGAlignedXLogBlock zbuffer; > + > + memset(zbuffer.data, 0, XLOG_BLCKSZ); > > This seems excessive for only writing a single byte.
Yes, I removed it now, instead doing pg_pwrite(fd, "\0", 1, wal_segment_size - 1). > +#ifdef WIN32 > + /* > + * XXX: It looks like on Windows, we need an explicit lseek() call > here > + * despite using pwrite() implementation from win32pwrite.c. > Otherwise > + * an error occurs. > + */ > > I think this comment is too vague. Can we describe the error in more > detail? Or better yet, can we fix it as a prerequisite to this patch set? The commit b6d8a60aba322678585ebe11dab072a37ac32905 brings back pg_pwrite() and its friends. This puts the responsibility of doing lseek(SEEK_SET) on the callers if they wish to. Please see the v5 patch set and review it further. -- Bharath Rupireddy PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com
v5-0001-Move-pg_pwritev_with_retry-to-file_utils.c.patch
Description: Binary data
v5-0002-Use-pg_pwritev_with_retry-instead-of-write-in-wal.patch
Description: Binary data