Re: BUG #15636: PostgreSQL 11.1 pg_basebackup backup to a CIFS destination throws fsync error at end of backup

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: John Klann <jk7255(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #15636: PostgreSQL 11.1 pg_basebackup backup to a CIFS destination throws fsync error at end of backup
Date: 2019-02-15 04:10:42
Message-ID: CAEepm=05ff+GRYdVE7+SdDuTVbPqW+Gmpwqir0NtAWNM70jg3g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Feb 15, 2019 at 11:53 AM John Klann <jk7255(at)gmail(dot)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

Attachment Content-Type Size
0001-Tolerate-EINVAL-when-calling-fsync-on-a-directory.patch application/octet-stream 1.9 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message John Klann 2019-02-15 04:27:11 Re: BUG #15636: PostgreSQL 11.1 pg_basebackup backup to a CIFS destination throws fsync error at end of backup
Previous Message PG Bug reporting form 2019-02-15 02:43:02 BUG #15637: Problem insert data 【Japanese】