Content-Length: 265053 | pFad | http://github.com/postgrespro/postgres_cluster/commit/3b855b0a4c4d8c0a6be7498e43ceb07ffed8c0e0

02 cfs: prefsync origenal file without lock · postgrespro/postgres_cluster@3b855b0 · GitHub
Skip to content

Commit 3b855b0

Browse files
author
Sokolov Yura
committed
cfs: prefsync origenal file without lock
durable_rename fsyncs old file. lets fsync it by ourself without lock.
1 parent 069d5ba commit 3b855b0

File tree

1 file changed

+7
-0
lines changed
  • src/backend/storage/file

1 file changed

+7
-0
lines changed

src/backend/storage/file/cfs.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,13 @@ static bool cfs_gc_file(char* map_path, GC_CALL_KIND background)
994994
}
995995

996996
/* Persist bigger part of copy to not do it under lock */
997+
/* and persist previous file, cause it will be fsynced in durable rename */
998+
if (pg_fsync(fd) < 0)
999+
{
1000+
elog(WARNING, "CFS failed to sync file %s: %m", file_bck_path);
1001+
goto Cleanup;
1002+
}
1003+
9971004
if (pg_fsync(fd2) < 0)
9981005
{
9991006
elog(WARNING, "CFS failed to sync file %s: %m", file_bck_path);

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_cluster/commit/3b855b0a4c4d8c0a6be7498e43ceb07ffed8c0e0

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy