pg_basebackup fsyncs some files despite --no-sync (was: Adding CI to our tree)
От
Andres Freund
Тема
pg_basebackup fsyncs some files despite --no-sync (was: Adding CI to our tree)
Дата
Msg-id
20220121200057.fcp7onggjhbkbu7q@alap3.anarazel.de
Ответ на
Re: Adding CI to our tree (Andres Freund)
Список
Дерево обсуждения
Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Daniel Gustafsson <daniel@yesql.se>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Daniel Gustafsson <daniel@yesql.se>
Re: Adding CI to our tree Daniel Gustafsson <daniel@yesql.se>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Daniel Gustafsson <daniel@yesql.se>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
ssl tests fail on windows / slurp_file() offset doesn't work on win Andres Freund <andres@anarazel.de>
Re: ssl tests fail on windows / slurp_file() offset doesn't work on win Andres Freund <andres@anarazel.de>
Re: ssl tests fail on windows / slurp_file() offset doesn't work on win Andrew Dunstan <andrew@dunslane.net>
Re: ssl tests fail on windows / slurp_file() offset doesn't work on win Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Daniel Gustafsson <daniel@yesql.se>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Melanie Plageman <melanieplageman@gmail.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Thomas Munro <thomas.munro@gmail.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Daniel Gustafsson <daniel@yesql.se>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Tom Lane <tgl@sss.pgh.pa.us>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Tom Lane <tgl@sss.pgh.pa.us>
Re: Adding CI to our tree Daniel Gustafsson <daniel@yesql.se>
Re: Adding CI to our tree Andrew Dunstan <andrew@dunslane.net>
Re: Adding CI to our tree Tom Lane <tgl@sss.pgh.pa.us>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Andrew Dunstan <andrew@dunslane.net>
Re: Adding CI to our tree Thomas Munro <thomas.munro@gmail.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Daniel Gustafsson <daniel@yesql.se>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Andrew Dunstan <andrew@dunslane.net>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Andrew Dunstan <andrew@dunslane.net>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Andrew Dunstan <andrew@dunslane.net>
Re: Adding CI to our tree Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: Adding CI to our tree Andrew Dunstan <andrew@dunslane.net>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Andrew Dunstan <andrew@dunslane.net>
Re: Adding CI to our tree Robert Haas <robertmhaas@gmail.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Tom Lane <tgl@sss.pgh.pa.us>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Tom Lane <tgl@sss.pgh.pa.us>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
pg_basebackup fsyncs some files despite --no-sync (was: Adding CI to our tree) Andres Freund <andres@anarazel.de>
Re: pg_basebackup fsyncs some files despite --no-sync (was: Adding CI to our tree) Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Tom Lane <tgl@sss.pgh.pa.us>
Re: Adding CI to our tree Tom Lane <tgl@sss.pgh.pa.us>
Re: Adding CI to our tree Tom Lane <tgl@sss.pgh.pa.us>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Tom Lane <tgl@sss.pgh.pa.us>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Thomas Munro <thomas.munro@gmail.com>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Thomas Munro <thomas.munro@gmail.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Thomas Munro <thomas.munro@gmail.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: Adding CI to our tree Robert Haas <robertmhaas@gmail.com>
Re: Adding CI to our tree Tom Lane <tgl@sss.pgh.pa.us>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Tom Lane <tgl@sss.pgh.pa.us>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree (ccache) Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree (ccache) Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree (ccache) Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree (ccache) Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree (ccache) Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree (ccache) Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree (ccache) Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree (ccache) Justin Pryzby <pryzby@telsasoft.com>
Re: Adding CI to our tree Tom Lane <tgl@sss.pgh.pa.us>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Thomas Munro <thomas.munro@gmail.com>
Re: Adding CI to our tree Andres Freund <andres@anarazel.de>
Re: Adding CI to our tree Thomas Munro <thomas.munro@gmail.com>
Re: Adding CI to our tree Peter Geoghegan <pg@bowt.ie>
Hi,
On 2022-01-18 20:16:46 -0800, Andres Freund wrote:
> I noticed a few other sources of "unnecessary" fsyncs. The most frequent
> being the durable_rename() of backup_manifest in pg_basebackup.c. Manifests are
> surprisingly large, 135k for a freshly initdb'd cluster.
Robert, I assume the fsync for manifests isn't ignoring --no-sync for a
particular reason?
The attached patch adds no-sync handling to the manifest rename, as well as
one case in the directory wal method.
It's a bit painful that we have to have code like
if (dir_data->sync)
r = durable_rename(tmppath, tmppath2);
else
{
if (rename(tmppath, tmppath2) != 0)
{
pg_log_error("could not rename file \"%s\" to \"%s\": %m",
tmppath, tmppath2);
r = -1;
}
}
It seems like it'd be better to set it up so that durable_rename() could
decide internally wether to fsync, or have a wrapper around durable_rename()?
> There's an fsync in walmethods.c:tar_close() that sounds intentional, but I
> don't really understand what the comment:
>
> /* Always fsync on close, so the padding gets fsynced */
> if (tar_sync(f) < 0)
tar_sync() actually checks for tar_data->sync, so it doesn't do an
fsync. Arguably the comment is a bit confusing, but ...
Greetings,
Andres Freund
В списке pgsql-hackers по дате отправления
От: Tom Lane
Дата:
От: Greg Stark
Дата: