Skip to content

Commit 9e79ca3

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 cb86785 commit 9e79ca3

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
@@ -2418,18 +2418,15 @@ pre_sync_fname(const char *fname, bool isdir, int elevel)
24182418
{
24192419
if (errno == EACCES || (isdir && errno == EISDIR))
24202420
return;
2421-
2422-
#ifdef ETXTBSY
2423-
if (errno == ETXTBSY)
2424-
return;
2425-
#endif
2426-
24272421
ereport(elevel,
24282422
(errcode_for_file_access(),
24292423
errmsg("could not open file \"%s\": %m", fname)));
24302424
return;
24312425
}
24322426

2427+
/*
2428+
* We ignore errors from pg_flush_data() because this is only a hint.
2429+
*/
24332430
(void) pg_flush_data(fd, 0, 0);
24342431

24352432
(void) close(fd);
@@ -2473,12 +2470,6 @@ fsync_fname_ext(const char *fname, bool isdir, int elevel)
24732470
{
24742471
if (errno == EACCES || (isdir && errno == EISDIR))
24752472
return;
2476-
2477-
#ifdef ETXTBSY
2478-
if (errno == ETXTBSY)
2479-
return;
2480-
#endif
2481-
24822473
ereport(elevel,
24832474
(errcode_for_file_access(),
24842475
errmsg("could not open file \"%s\": %m", fname)));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy