File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 54
54
#include "utils/guc.h"
55
55
#include "utils/rel.h"
56
56
#include "utils/builtins.h"
57
+ #include "utils/memutils.h"
57
58
#include "utils/resowner_private.h"
58
59
59
60
@@ -1427,6 +1428,7 @@ static bool cfs_gc_scan_tablespace(int worker_id)
1427
1428
1428
1429
static void cfs_gc_bgworker_main (Datum arg )
1429
1430
{
1431
+ MemoryContext MemCxt ;
1430
1432
int worker_id = DatumGetInt32 (arg );
1431
1433
1432
1434
pqsignal (SIGINT , cfs_gc_cancel );
@@ -1439,6 +1441,9 @@ static void cfs_gc_bgworker_main(Datum arg)
1439
1441
1440
1442
elog (INFO , "Start CFS garbage collector %d (enabled=%d)" , MyProcPid , cfs_state -> background_gc_enabled );
1441
1443
1444
+ MemCxt = AllocSetContextCreate (TopMemoryContext , "CFS worker ctx" ,
1445
+ ALLOCSET_DEFAULT_SIZES );
1446
+ MemoryContextSwitchTo (MemCxt );
1442
1447
while (true)
1443
1448
{
1444
1449
int timeout = cfs_gc_period ;
@@ -1448,6 +1453,7 @@ static void cfs_gc_bgworker_main(Datum arg)
1448
1453
{
1449
1454
timeout = CFS_RETRY_TIMEOUT ;
1450
1455
}
1456
+ MemoryContextReset (MemCxt );
1451
1457
if (cfs_gc_stop || -- cfs_state -> max_iterations <= 0 )
1452
1458
{
1453
1459
break ;
You can’t perform that action at this time.
0 commit comments