]> granicus.if.org Git - postgresql/commit
Tolerate ENOSYS failure from sync_file_range().
authorThomas Munro <tmunro@postgresql.org>
Sun, 24 Feb 2019 00:38:15 +0000 (13:38 +1300)
committerThomas Munro <tmunro@postgresql.org>
Sun, 24 Feb 2019 09:37:20 +0000 (22:37 +1300)
commit483520eca426fb1b428e8416d1d014ac5ad80ef4
treef459a0c02544d3f39530ad7578290e82f767cb73
parentf27522553992132d34c67caeea193d57934111cf
Tolerate ENOSYS failure from sync_file_range().

One unintended consequence of commit 9ccdd7f6 was that Windows WSL
users started getting a panic whenever we tried to initiate data
flushing with sync_file_range(), because WSL does not implement that
system call.  Previously, they got a stream of periodic warnings,
which was also undesirable but at least ignorable.

Prevent the panic by handling ENOSYS specially and skipping the panic
promotion with data_sync_elevel().  Also suppress future attempts
after the first such failure so that the pre-existing problem of
noisy warnings is improved.

Back-patch to 9.6 (older branches were not affected in this way by
9ccdd7f6).

Author: Thomas Munro and James Sewell
Tested-by: James Sewell
Reported-by: Bruce Klein
Discussion: https://postgr.es/m/CA+mCpegfOUph2U4ZADtQT16dfbkjjYNJL1bSTWErsazaFjQW9A@mail.gmail.com
src/backend/storage/file/fd.c