Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit57e1138

Browse files
committed
Remove special cases for ETXTBSY from new fsync'ing logic.
The argument that this is a sufficiently-expected case to be silentlyignored seems pretty thin. Andres had brought it up back when we werestill considering that most fsync failures should be hard errors, and itprobably would be legit not to fail hard for ETXTBSY --- but the same istrue 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 finefrom here.
1 parent1c8c656 commit57e1138

File tree

2 files changed

+3
-24
lines changed

2 files changed

+3
-24
lines changed

‎src/backend/storage/file/fd.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2648,18 +2648,15 @@ pre_sync_fname(const char *fname, bool isdir, int elevel)
26482648
{
26492649
if (errno==EACCES|| (isdir&&errno==EISDIR))
26502650
return;
2651-
2652-
#ifdefETXTBSY
2653-
if (errno==ETXTBSY)
2654-
return;
2655-
#endif
2656-
26572651
ereport(elevel,
26582652
(errcode_for_file_access(),
26592653
errmsg("could not open file \"%s\": %m",fname)));
26602654
return;
26612655
}
26622656

2657+
/*
2658+
* We ignore errors from pg_flush_data() because this is only a hint.
2659+
*/
26632660
(void)pg_flush_data(fd,0,0);
26642661

26652662
(void)CloseTransientFile(fd);
@@ -2703,12 +2700,6 @@ fsync_fname_ext(const char *fname, bool isdir, int elevel)
27032700
{
27042701
if (errno==EACCES|| (isdir&&errno==EISDIR))
27052702
return;
2706-
2707-
#ifdefETXTBSY
2708-
if (errno==ETXTBSY)
2709-
return;
2710-
#endif
2711-
27122703
ereport(elevel,
27132704
(errcode_for_file_access(),
27142705
errmsg("could not open file \"%s\": %m",fname)));

‎src/bin/initdb/initdb.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -619,12 +619,6 @@ pre_sync_fname(const char *fname, bool isdir)
619619
{
620620
if (errno==EACCES|| (isdir&&errno==EISDIR))
621621
return;
622-
623-
#ifdefETXTBSY
624-
if (errno==ETXTBSY)
625-
return;
626-
#endif
627-
628622
fprintf(stderr,_("%s: could not open file \"%s\": %s\n"),
629623
progname,fname,strerror(errno));
630624
return;
@@ -684,12 +678,6 @@ fsync_fname_ext(const char *fname, bool isdir)
684678
{
685679
if (errno==EACCES|| (isdir&&errno==EISDIR))
686680
return;
687-
688-
#ifdefETXTBSY
689-
if (errno==ETXTBSY)
690-
return;
691-
#endif
692-
693681
fprintf(stderr,_("%s: could not open file \"%s\": %s\n"),
694682
progname,fname,strerror(errno));
695683
return;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp