Skip to content

Commit 220f637

Browse files
author
Sokolov Yura
committed
cfs: pg_flush_data on second pass
1 parent 97322d2 commit 220f637

File tree

1 file changed

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

1 file changed

+8
-0
lines changed

src/backend/storage/file/cfs.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,6 +1053,13 @@ static bool cfs_gc_file(char* map_path, GC_CALL_KIND background)
10531053
goto Cleanup;
10541054
}
10551055
newMap->inodes[i] = CFS_INODE(size, offs);
1056+
1057+
if (writeback + 16*1024*1024 < newSize)
1058+
{
1059+
uint32 newwb = (newSize - 128*1024) & ~(128*1024-1);
1060+
pg_flush_data(fd2, writeback, newwb - writeback);
1061+
writeback = newwb;
1062+
}
10561063
}
10571064
else
10581065
{
@@ -1061,6 +1068,7 @@ static bool cfs_gc_file(char* map_path, GC_CALL_KIND background)
10611068
cfs_state->gc_stat.processedBytes += size;
10621069
cfs_state->gc_stat.processedPages += 1;
10631070
}
1071+
pg_flush_data(fd2, writeback, newSize);
10641072

10651073
if (close(fd) < 0)
10661074
{

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