]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Remove special cases for ETXTBSY from new fsync'ing logic.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 29 May 2015 19:11:36 +0000 (15:11 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 29 May 2015 19:11:36 +0000 (15:11 -0400)
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

index 7aaed00839cc5485ed2405252c2d0a0d5b9b9457..a8db0a471911befa5bd0f04ca83e6a8b0c855707 100644 (file)
@@ -2216,18 +2216,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) close(fd);
@@ -2271,12 +2268,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)));