Re: Windows now has fdatasync()

Поиск
Список
Период
Сортировка
От Sascha Kuhl
Тема Re: Windows now has fdatasync()
Дата
Msg-id CAPvVvKAdG_NT=Tn8UrZt7CRojScR_VqPA3n_mTSp++wTkHZoAw@mail.gmail.com
обсуждение исходный текст
Ответ на Windows now has fdatasync()  (Thomas Munro <thomas.munro@gmail.com>)
Список pgsql-hackers
Great. File sync is a Nice extension for me, as I don't know all file structures.

Thomas Munro <thomas.munro@gmail.com> schrieb am So., 12. Dez. 2021, 03:48:
Hi,

While porting some new IO code to lots of OSes I noticed in passing
that there is now a way to do synchronous fdatasync() on Windows.
This mechanism doesn't have an async variant, which is what I was
actually looking for (which turns out to doable with bleeding edge
IoRings, more on that later), but I figured this might be useful
anyway.  I see that at least one other open source database has
discovered it and seen speedups.  Like some other file API
improvements discussed recently, it's Windows 10+ and NTFS only.  I
tried out a quick POC patch and it runs a bit faster than fsync(), as
expected.  I'm not sure if it's worth bothering with or not given the
other options, but figured it was worth sharing.

While testing that I also couldn't resist adding an extra output line
to pg_test_fsync to run open_datasync in buffered I/O mode, like
PostgreSQL actually does in real life.  I guess I should really change
it to duplicate less code, though...

[1] https://www.postgresql.org/message-id/flat/1527846213.2475.31.camel%40cybertec.at

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: extended stats on partitioned tables
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_dump versus ancient server versions