Re: BUG #15636: PostgreSQL 11.1 pg_basebackup backup to a CIFS destination throws fsync error at end of backup
Thomas Munro <thomas.munro@enterprisedb.com>
From: Thomas Munro <thomas.munro@enterprisedb.com>
To: John Klann <jk7255@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2019-02-15T04:10:42Z
Lists: pgsql-bugs
Attachments
- 0001-Tolerate-EINVAL-when-calling-fsync-on-a-directory.patch (application/octet-stream) patch 0001
On Fri, Feb 15, 2019 at 11:53 AM John Klann <jk7255@gmail.com> wrote:
>>> >> Hmm, it looks like your system gives EINVAL when you try to fsync a
>>> >> directory. Perhaps we should teach fsync__fname() about that here:
>>> >>
>>> >> /*
>>> >> * Some OSes don't allow us to fsync directories at all, so we
>>> >> can ignore
>>> >> * those errors. Anything else needs to be reported.
>>> >> */
>>> >> if (returncode != 0 && !(isdir && errno == EBADF))
>>> >> {
>>> >> fprintf(stderr, _("%s: could not fsync file \"%s\": %s\n"),
>>> >> progname, fname, strerror(errno));
>>> >> (void) close(fd);
>>> >> return -1;
>>> >> }
Here is a patch like that. Any chance you could test it? Happy to
send instructions on how to do that if necessary. Does anyone think
it'd be a bad idea to do this, and possibly even back-patch it? We
have tolerated EBADF since 7d7db18a (which OS is that for?)
--
Thomas Munro
http://www.enterprisedb.com
Commits
-
Tolerate EINVAL when calling fsync() on a directory.
- ede6b19624d1 9.4.22 landed
- 0ec89a0f6752 9.5.17 landed
- ad714c6072c9 9.6.13 landed
- bcf627834344 10.8 landed
- 4d67357dbf50 11.3 landed
- f16735d80d2f 12.0 landed