File tree Expand file tree Collapse file tree 2 files changed +18
-8
lines changed Expand file tree Collapse file tree 2 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -1107,13 +1107,22 @@ static void cfs_gc_bgworker_main(Datum arg)
1107
1107
1108
1108
elog (INFO , "Start CFS garbage collector %d" , MyProcPid );
1109
1109
1110
- while (cfs_gc_scan_tablespace (worker_id )
1111
- && !cfs_gc_stop
1112
- && -- cfs_state -> max_iterations >= 0 )
1110
+ while (true)
1113
1111
{
1114
- int rc = WaitLatch (MyLatch ,
1115
- WL_TIMEOUT | WL_POSTMASTER_DEATH ,
1116
- cfs_gc_period /* ms */ );
1112
+ int timeout = cfs_gc_period ;
1113
+ int rc ;
1114
+
1115
+ if (!cfs_gc_scan_tablespace (worker_id ))
1116
+ {
1117
+ timeout = CFS_RETRY_TIMEOUT ;
1118
+ }
1119
+ if (cfs_gc_stop || -- cfs_state -> max_iterations <= 0 )
1120
+ {
1121
+ break ;
1122
+ }
1123
+ rc = WaitLatch (MyLatch ,
1124
+ WL_TIMEOUT | WL_POSTMASTER_DEATH ,
1125
+ timeout /* ms */ );
1117
1126
if (rc & WL_POSTMASTER_DEATH )
1118
1127
exit (1 );
1119
1128
}
Original file line number Diff line number Diff line change 10
10
11
11
#define CFS_GC_LOCK 0x10000000
12
12
13
- #define CFS_LOCK_MIN_TIMEOUT 100 /* microseconds */
13
+ #define CFS_LOCK_MIN_TIMEOUT 100 /* microseconds: initial timeout of GC lock acquisition */
14
14
#define CFS_LOCK_MAX_TIMEOUT 10000 /* microseconds */
15
- #define CFS_DISABLE_TIMEOUT 1000 /* milliseconds */
15
+ #define CFS_DISABLE_TIMEOUT 1000 /* milliseconds: timeout of waiting for enabling GC */
16
+ #define CFS_RETRY_TIMEOUT 10000 /* milliseconds: delay between GC iterations in case of error */
16
17
#define CFS_ESTIMATE_PROBES 10
17
18
18
19
/*
You can’t perform that action at this time.
0 commit comments