Hi, On Fri, 31 Jul 2026 at 15:31, solai v <[email protected]> wrote:
> Hi all, > > Thanks for the updated patch. I tested this patch and was able to > verify the new pg_wal_preallocate() functionality on a freshly > initialized cluster. Before invoking the function, the pg_wal > directory contained a single WAL segment. Executing: SELECT > pg_wal_preallocate(), returned 5, and I confirmed that 5 additional > WAL segment files were created in the pg_wal directory, matching the > configured min_wal_size target. I also verified the updated default > behavior discussed in the thread. The default invocation only created > the missing segments needed to satisfy the min_wal_size window ahead > of the current insertion point, rather than creating an arbitrary > number of WAL segments. I then reset the WAL and I/O statistics and > executed a workload generating approximately 3.3 GB of WAL using a > 5-million-row INSERT. Since the default invocation only preallocated > enough segments to satisfy min_wal_size (80 MB in my setup), the > workload still required additional WAL segment creation during > execution. This behavior seems consistent with the intended design and > the discussion in the thread. I did not encounter any functional > issues during testing. > Thanks for testing! Rebased patch attached. Regards, Ayush
v3-0001-pg_wal_preallocate.patch
Description: Binary data
