missing PG_IO_ALIGN_SIZE uses
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-12-01T07:55:50Z
Lists: pgsql-hackers
Attachments
- 0001-Use-PG_IO_ALIGN_SIZE-for-aligning-WAL-buffers.patch (text/plain) patch 0001
- 0002-Use-PGAlignedXLogBlock-in-BootStrapXLOG.patch (text/plain) patch 0002
- 0003-pg_test_fsync-Align-test-data-using-PGAlignedXLogBlo.patch (text/plain) patch 0003
Commit faeedbcefd4 changed the alignment of WAL buffers from XLOG_BLCKSZ to PG_IO_ALIGN_SIZE. While looking around for places to apply alignas, I think I found at least two places that were forgotten, namely in BootStrapXLOG() and in pg_test_fsync.c. Patches attached for those. I also suspect that the TYPEALIGN call in XLOGShmemInit() should take PG_IO_ALIGN_SIZE into account, but it's not immediately obvious how, since the comment also mentions that it wants alignment on "a full xlog block size boundary". Maybe Max(XLOG_BLCKSZ, PG_IO_ALIGN_SIZE)? I also wonder whether the check in check_debug_io_direct() for #if XLOG_BLCKSZ < PG_IO_ALIGN_SIZE would be required if we fixed all those places?
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Use PGAlignedXLogBlock for some code simplification
- 804046b39a27 19 (unreleased) landed
-
Introduce PG_IO_ALIGN_SIZE and align all I/O buffers.
- faeedbcefd40 16.0 cited