Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?
От
Michael Paquier
Тема
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?
Дата
Msg-id
Y1oc+FjiyVjNZa+L@paquier.xyz
Ответ на
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? (Nathan Bossart)
Список
Дерево обсуждения
Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Michael Paquier <michael@paquier.xyz>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Thomas Munro <thomas.munro@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Michael Paquier <michael@paquier.xyz>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Thomas Munro <thomas.munro@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Nathan Bossart <nathandbossart@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Nathan Bossart <nathandbossart@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Nathan Bossart <nathandbossart@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Thomas Munro <thomas.munro@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Nathan Bossart <nathandbossart@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Thomas Munro <thomas.munro@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Nathan Bossart <nathandbossart@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Thomas Munro <thomas.munro@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Thomas Munro <thomas.munro@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Thomas Munro <thomas.munro@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Nathan Bossart <nathandbossart@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Thomas Munro <thomas.munro@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Nathan Bossart <nathandbossart@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Michael Paquier <michael@paquier.xyz>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Andres Freund <andres@anarazel.de>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Michael Paquier <michael@paquier.xyz>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Andres Freund <andres@anarazel.de>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Michael Paquier <michael@paquier.xyz>
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>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Michael Paquier <michael@paquier.xyz>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Andres Freund <andres@anarazel.de>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Andres Freund <andres@anarazel.de>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Andres Freund <andres@anarazel.de>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Andres Freund <andres@anarazel.de>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Andres Freund <andres@anarazel.de>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Michael Paquier <michael@paquier.xyz>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Andres Freund <andres@anarazel.de>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Michael Paquier <michael@paquier.xyz>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Andres Freund <andres@anarazel.de>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Michael Paquier <michael@paquier.xyz>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Michael Paquier <michael@paquier.xyz>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Andres Freund <andres@anarazel.de>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Michael Paquier <michael@paquier.xyz>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Thomas Munro <thomas.munro@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Thomas Munro <thomas.munro@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Andres Freund <andres@anarazel.de>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Michael Paquier <michael@paquier.xyz>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Thomas Munro <thomas.munro@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Julien Rouhaud <rjuju123@gmail.com>
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>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Thomas Munro <thomas.munro@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Michael Paquier <michael@paquier.xyz>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Andres Freund <andres@anarazel.de>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Michael Paquier <michael@paquier.xyz>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Andres Freund <andres@anarazel.de>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Michael Paquier <michael@paquier.xyz>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Michael Paquier <michael@paquier.xyz>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? John Naylor <john.naylor@enterprisedb.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Michael Paquier <michael@paquier.xyz>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? John Naylor <john.naylor@enterprisedb.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes? Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
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. Regarding 0002, using pg_pwrite_zeros() as a routine name, as suggested by Thomas, sounds good to me. However, I am not really a fan of its dependency with PGAlignedXLogBlock, because it should be able to work with any buffers of any sizes, as long as the input buffer is aligned, shouldn't it? For example, what about PGAlignedBlock? So, should we make this more extensible? My guess would be the addition of the block size and the block pointer to the arguments of pg_pwrite_zeros(), in combination with a check to make sure that the input buffer is MAXALIGN()'d (with an Assert() rather than just an elog/pg_log_error?). -- Michael
В списке pgsql-hackers по дате отправления
От: Bharath Rupireddy
Дата: