Skip to content

Commit bf2f20c

Browse files
committed
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.
1 parent e4a04e5 commit bf2f20c

File tree

1 file changed

+3
-12
lines changed
  • src/backend/storage/file

1 file changed

+3
-12
lines changed

src/backend/storage/file/fd.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2216,18 +2216,15 @@ pre_sync_fname(const char *fname, bool isdir, int elevel)
22162216
{
22172217
if (errno == EACCES || (isdir && errno == EISDIR))
22182218
return;
2219-
2220-
#ifdef ETXTBSY
2221-
if (errno == ETXTBSY)
2222-
return;
2223-
#endif
2224-
22252219
ereport(elevel,
22262220
(errcode_for_file_access(),
22272221
errmsg("could not open file \"%s\": %m", fname)));
22282222
return;
22292223
}
22302224

2225+
/*
2226+
* We ignore errors from pg_flush_data() because this is only a hint.
2227+
*/
22312228
(void) pg_flush_data(fd, 0, 0);
22322229

22332230
(void) close(fd);
@@ -2271,12 +2268,6 @@ fsync_fname_ext(const char *fname, bool isdir, int elevel)
22712268
{
22722269
if (errno == EACCES || (isdir && errno == EISDIR))
22732270
return;
2274-
2275-
#ifdef ETXTBSY
2276-
if (errno == ETXTBSY)
2277-
return;
2278-
#endif
2279-
22802271
ereport(elevel,
22812272
(errcode_for_file_access(),
22822273
errmsg("could not open file \"%s\": %m", fname)));

0 commit comments

Comments
 (0)