pgsql: Tolerate ENOSYS failure from sync_file_range(). - Mailing list pgsql-committers

From Thomas Munro
Subject pgsql: Tolerate ENOSYS failure from sync_file_range().
Date
Msg-id E1gxqmx-00012o-6E@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/483520eca426fb1b428e8416d1d014ac5ad80ef4

Modified Files
--------------
src/backend/storage/file/fd.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: pgsql: pg_regress: Don't use absolute paths for the diff
Next
From: Thomas Munro
Date:
Subject: pgsql: Tolerate ENOSYS failure from sync_file_range().