|
55 | 55 | #include "storage/barrier.h"
|
56 | 56 | #include "storage/bufmgr.h"
|
57 | 57 | #include "storage/fd.h"
|
| 58 | +#include "storage/cfs.h" |
58 | 59 | #include "storage/ipc.h"
|
59 | 60 | #include "storage/large_object.h"
|
60 | 61 | #include "storage/latch.h"
|
@@ -122,6 +123,7 @@ int CheckPointSegments;
|
122 | 123 | /* Estimated distance between checkpoints, in bytes */
|
123 | 124 | static double CheckPointDistanceEstimate = 0;
|
124 | 125 | static double PrevCheckPointDistance = 0;
|
| 126 | +static bool SavedGCState = false; |
125 | 127 |
|
126 | 128 | /*
|
127 | 129 | * GUC support
|
@@ -9905,6 +9907,8 @@ do_pg_start_backup(const char *backupidstr, bool fast, TimeLineID *starttli_p,
|
9905 | 9907 | XLogCtl->Insert.forcePageWrites = true;
|
9906 | 9908 | WALInsertLockRelease();
|
9907 | 9909 |
|
| 9910 | + SavedGCState = cfs_control_gc(false); /* disable GC during backup */ |
| 9911 | + |
9908 | 9912 | /* Ensure we release forcePageWrites if fail below */
|
9909 | 9913 | PG_ENSURE_ERROR_CLEANUP(pg_start_backup_callback, (Datum) BoolGetDatum(exclusive));
|
9910 | 9914 | {
|
@@ -10267,6 +10271,8 @@ pg_start_backup_callback(int code, Datum arg)
|
10267 | 10271 | XLogCtl->Insert.forcePageWrites = false;
|
10268 | 10272 | }
|
10269 | 10273 | WALInsertLockRelease();
|
| 10274 | + |
| 10275 | + cfs_control_gc(SavedGCState); /* Restore CFS GC activity */ |
10270 | 10276 | }
|
10271 | 10277 |
|
10272 | 10278 | /*
|
@@ -10627,6 +10633,8 @@ do_pg_stop_backup(char *labelfile, bool waitforarchive, TimeLineID *stoptli_p)
|
10627 | 10633 | ereport(NOTICE,
|
10628 | 10634 | (errmsg("WAL archiving is not enabled; you must ensure that all required WAL segments are copied through other means to complete the backup")));
|
10629 | 10635 |
|
| 10636 | + cfs_control_gc(SavedGCState); /* Restore CFS GC activity */ |
| 10637 | + |
10630 | 10638 | /*
|
10631 | 10639 | * We're done. As a convenience, return the ending WAL location.
|
10632 | 10640 | */
|
|
0 commit comments