File tree 2 files changed +6
-1
lines changed
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -992,8 +992,11 @@ static bool cfs_gc_file(char* map_path, GC_CALL_KIND background)
992
992
cfs_gc_lock (lock );
993
993
994
994
/* Reread variables after locking file */
995
+ physSize = pg_atomic_read_u32 (& map -> hdr .physSize );
995
996
virtSize = pg_atomic_read_u32 (& map -> hdr .virtSize );
996
997
n_pages = virtSize / BLCKSZ ;
998
+ if (physSize >= CFS_RED_LINE )
999
+ goto forceWhole ;
997
1000
for (i = 0 ; i < n_pages ; i ++ )
998
1001
{
999
1002
newMap -> inodes [i ] = map -> inodes [i ];
@@ -1073,7 +1076,7 @@ static bool cfs_gc_file(char* map_path, GC_CALL_KIND background)
1073
1076
memset (newMap -> inodes , 0 , sizeof (newMap -> inodes ));
1074
1077
elog (LOG , "CFS: retry %d whole gc file %s" , second_pass_whole ,
1075
1078
file_path );
1076
- if (second_pass_whole == 1 && physSize < CFS_IMPLICIT_GC_THRESHOLD )
1079
+ if (second_pass_whole == 1 && physSize < CFS_RETRY_GC_THRESHOLD )
1077
1080
{
1078
1081
cfs_gc_unlock (lock );
1079
1082
/* sleep, cause there is possibly checkpoint is on a way */
@@ -1082,6 +1085,7 @@ static bool cfs_gc_file(char* map_path, GC_CALL_KIND background)
1082
1085
second_pass_bytes = 0 ;
1083
1086
goto retry ;
1084
1087
}
1088
+ forceWhole :
1085
1089
for (i = 0 ; i < n_pages ; i ++ )
1086
1090
{
1087
1091
newMap -> inodes [i ] = map -> inodes [i ];
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ typedef uint64 inode_t;
53
53
#define CFS_INODE_CLEAN_FLAG ((inode_t)1 << 63)
54
54
55
55
#define CFS_IMPLICIT_GC_THRESHOLD 0x80000000U /* 2Gb */
56
+ #define CFS_RETRY_GC_THRESHOLD 0x60000000U /* 1.5Gb */
56
57
#define CFS_RED_LINE 0xC0000000U /* 3Gb */
57
58
58
59
size_t cfs_compress (void * dst , size_t dst_size , void const * src , size_t src_size );
You can’t perform that action at this time.
0 commit comments