summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2015-05-29 15:11:36 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2015-05-29 15:11:36 -0400
commit77642a8197ed7fa3a5113bdca914e4685e957455 (patch)
tree2be4f2c2d535a616157ac93810533e9082e4f150 /src
parentaa8377e64ff0ddac5342979d0afb050eb178ff8a (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/backend/storage/file/fd.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index 03788f61c28..90d06bee181 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -2477,18 +2477,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);
@@ -2532,12 +2529,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)));