Use pg_pwrite_zeros() in walmethods.c
Michael Paquier <michael@paquier.xyz>
Use pg_pwrite_zeros() in walmethods.c This change impacts pg_receivewal and pg_basebackup, for the pre-padding with zeros of all the new non-compressed WAL segments, so as the code is more robust on partial writes. This makes the code consistent with the backend (XLogFileInitInternal) when wal_init_zeros is enabled for the WAL segment initialization. Author: Bharath Rupireddy Reviewed-by: Nathan Bossart, Andres Freund, Thomas Munro, Michael Paquier Discussion: https://postgr.es/m/CALj2ACUq7nAb7=bJNbK3yYmp-SZhJcXFR_pLk8un6XgDzDF3OA@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/bin/pg_basebackup/walmethods.c | modified | +11 −12 |
Discussion
- Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? 80 messages · 2022-08-05 → 2023-03-17