Content-Length: 300587 | pFad | http://github.com/postgrespro/postgres/commit/77642a8197ed7fa3a5113bdca914e4685e957455

F9 Remove special cases for ETXTBSY from new fsync'ing logic. · postgrespro/postgres@77642a8 · GitHub
Skip to content

Commit 77642a8

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 aa8377e commit 77642a8

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
@@ -2477,18 +2477,15 @@ pre_sync_fname(const char *fname, bool isdir, int elevel)
24772477
{
24782478
if (errno == EACCES || (isdir && errno == EISDIR))
24792479
return;
2480-
2481-
#ifdef ETXTBSY
2482-
if (errno == ETXTBSY)
2483-
return;
2484-
#endif
2485-
24862480
ereport(elevel,
24872481
(errcode_for_file_access(),
24882482
errmsg("could not open file \"%s\": %m", fname)));
24892483
return;
24902484
}
24912485

2486+
/*
2487+
* We ignore errors from pg_flush_data() because this is only a hint.
2488+
*/
24922489
(void) pg_flush_data(fd, 0, 0);
24932490

24942491
(void) close(fd);
@@ -2532,12 +2529,6 @@ fsync_fname_ext(const char *fname, bool isdir, int elevel)
25322529
{
25332530
if (errno == EACCES || (isdir && errno == EISDIR))
25342531
return;
2535-
2536-
#ifdef ETXTBSY
2537-
if (errno == ETXTBSY)
2538-
return;
2539-
#endif
2540-
25412532
ereport(elevel,
25422533
(errcode_for_file_access(),
25432534
errmsg("could not open file \"%s\": %m", fname)));

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/77642a8197ed7fa3a5113bdca914e4685e957455

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy