Skip to content

Commit 23d8b35

Browse files
committed
Fix missing fsync of SLRU directories.
Harmonize behavior by moving reponsibility for fsyncing directories down into slru.c. In 10 and later, only the multixact directories were missed (see commit 1b02be2), and in older branches all SLRUs were missed. Back-patch to all supported releases. Reviewed-by: Andres Freund <andres@anarazel.de> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/CA%2BhUKGLtsTUOScnNoSMZ-2ZLv%2BwGh01J6kAo_DM8mTRq1sKdSQ%40mail.gmail.com
1 parent 61cfd90 commit 23d8b35

File tree

1 file changed

+4
-0
lines changed
  • src/backend/access/transam

1 file changed

+4
-0
lines changed

src/backend/access/transam/slru.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,10 @@ SimpleLruFlush(SlruCtl ctl, bool allow_redirtied)
11331133
}
11341134
if (!ok)
11351135
SlruReportIOError(ctl, pageno, InvalidTransactionId);
1136+
1137+
/* Ensure that directory entries for new files are on disk. */
1138+
if (ctl->do_fsync)
1139+
fsync_fname(ctl->Dir, true);
11361140
}
11371141

11381142
/*

0 commit comments

Comments
 (0)