postgres.git / summary / log / commit / refs

commit    70a4519b82beee9e7bffb17ae4e6d81bb3ab89d8
Author:   Tom Lane <tgl@sss.pgh.pa.us>
Date:     Fri May 29 19:11:36 2015 +0000
First released in: 9.5.0, 9.0.21, 9.1.17, 9.2.12, 9.3.8, 9.4.3

    Remove special cases for ETXTBSY from new fsync'ing logic.
    
    The argument that this is a sufficiently-expected case to be silently
    ignored seems pretty thin.  Andres had brought it up back when we were
    still considering that most fsync failures should be hard errors, and it
    probably would be legit not to fail hard for ETXTBSY --- but the same is
    true for EROFS and other cases, which is why we gave up on hard failures.
    ETXTBSY is surely not a normal case, so logging the failure seems fine
    from here.


src/backend/storage/file/fd.c | 15 +++------------ src/bin/initdb/initdb.c | 12 ------------ 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c index 487188a791a..197d7d8707a 100644 --- a/src/backend/storage/file/fd.c +++ b/src/backend/storage/file/fd.c @@ -2647,18 +2647,15 @@ pre_sync_fname(const char *fname, bool isdir, int elevel) { if (errno == EACCES || (isdir && errno == EISDIR)) return; - -#ifdef ETXTBSY - if (errno == ETXTBSY) - return; -#endif - ereport(elevel, (errcode_for_file_access(), errmsg("could not open file \"%s\": %m", fname))); return; } + /* + * We ignore errors from pg_flush_data() because this is only a hint. + */ (void) pg_flush_data(fd, 0, 0); (void) CloseTransientFile(fd); @@ -2702,12 +2699,6 @@ fsync_fname_ext(const char *fname, bool isdir, int elevel) { if (errno == EACCES || (isdir && errno == EISDIR)) return; - -#ifdef ETXTBSY - if (errno == ETXTBSY) - return; -#endif - ereport(elevel, (errcode_for_file_access(), errmsg("could not open file \"%s\": %m", fname))); diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index 21f628f83d0..57f5f89dd94 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -627,12 +627,6 @@ pre_sync_fname(const char *fname, bool isdir) { if (errno == EACCES || (isdir && errno == EISDIR)) return; - -#ifdef ETXTBSY - if (errno == ETXTBSY) - return; -#endif - fprintf(stderr, _("%s: could not open file \"%s\": %s\n"), progname, fname, strerror(errno)); return; @@ -692,12 +686,6 @@ fsync_fname_ext(const char *fname, bool isdir) { if (errno == EACCES || (isdir && errno == EISDIR)) return; - -#ifdef ETXTBSY - if (errno == ETXTBSY) - return; -#endif - fprintf(stderr, _("%s: could not open file \"%s\": %s\n"), progname, fname, strerror(errno)); return; [parent: dbde225b1448]