@@ -128,7 +128,6 @@ int CheckPointSegments;
128
128
/* Estimated distance between checkpoints, in bytes */
129
129
static double CheckPointDistanceEstimate = 0 ;
130
130
static double PrevCheckPointDistance = 0 ;
131
- static bool SavedGCState = false;
132
131
133
132
/*
134
133
* GUC support
@@ -9894,7 +9893,7 @@ do_pg_start_backup(const char *backupidstr, bool fast, TimeLineID *starttli_p,
9894
9893
XLogCtl -> Insert .forcePageWrites = true;
9895
9894
WALInsertLockRelease ();
9896
9895
9897
- SavedGCState = cfs_control_gc (false ); /* disable GC during backup */
9896
+ cfs_control_gc_lock ( ); /* disable GC during backup */
9898
9897
9899
9898
/* Ensure we release forcePageWrites if fail below */
9900
9899
PG_ENSURE_ERROR_CLEANUP (pg_start_backup_callback , (Datum ) BoolGetDatum (exclusive ));
@@ -10273,7 +10272,7 @@ pg_start_backup_callback(int code, Datum arg)
10273
10272
}
10274
10273
WALInsertLockRelease ();
10275
10274
10276
- cfs_control_gc ( SavedGCState ); /* Restore CFS GC activity */
10275
+ cfs_control_gc_unlock ( ); /* Restore CFS GC activity */
10277
10276
}
10278
10277
10279
10278
/*
@@ -10473,7 +10472,7 @@ do_pg_stop_backup(char *labelfile, bool waitforarchive, TimeLineID *stoptli_p)
10473
10472
/* Clean up session-level lock */
10474
10473
sessionBackupState = SESSION_BACKUP_NONE ;
10475
10474
10476
- cfs_control_gc ( SavedGCState ); /* Restore CFS GC activity */
10475
+ cfs_control_gc_unlock ( ); /* Restore CFS GC activity */
10477
10476
10478
10477
/*
10479
10478
* Read and parse the START WAL LOCATION line (this code is pretty crude,
@@ -10717,6 +10716,8 @@ do_pg_abort_backup(void)
10717
10716
XLogCtl -> Insert .forcePageWrites = false;
10718
10717
}
10719
10718
WALInsertLockRelease ();
10719
+
10720
+ cfs_control_gc_unlock (); /* Restore CFS GC activity */
10720
10721
}
10721
10722
10722
10723
/*
0 commit comments