1
+ diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
2
+ index 34a2c71812..2d73d8023e 100644
3
+ --- a/src/backend/access/transam/xlog.c
4
+ +++ b/src/backend/access/transam/xlog.c
5
+ @@ -135,6 +135,7 @@ int wal_retrieve_retry_interval = 5000;
6
+ int max_slot_wal_keep_size_mb = -1;
7
+ int wal_decode_buffer_size = 512 * 1024;
8
+ bool track_wal_io_timing = false;
9
+ + backup_checkpoint_request_hook_type backup_checkpoint_request_hook = NULL;
10
+
11
+ #ifdef WAL_DEBUG
12
+ bool XLOG_DEBUG = false;
13
+ @@ -8801,6 +8802,12 @@ do_pg_backup_start(const char *backupidstr, bool fast, List **tablespaces,
14
+ {
15
+ bool checkpointfpw;
16
+
17
+ + /*
18
+ + * Before we call RequestCheckpoint() we need to set
19
+ + * init_lsn for ptrack map
20
+ + */
21
+ + if (backup_checkpoint_request_hook)
22
+ + backup_checkpoint_request_hook();
23
+ /*
24
+ * Force a CHECKPOINT. Aside from being necessary to prevent torn
25
+ * page problems, this guarantees that two successive backup runs
1
26
diff --git a/src/backend/backup/basebackup.c b/src/backend/backup/basebackup.c
2
- index 5fbbe5ffd20..3c9b99f851d 100644
27
+ index 9a2bf59e84..ade9115651 100644
3
28
--- a/src/backend/backup/basebackup.c
4
29
+++ b/src/backend/backup/basebackup.c
5
30
@@ -220,6 +220,13 @@ static const struct exclude_list_item excludeFiles[] =
@@ -17,7 +42,7 @@ index 5fbbe5ffd20..3c9b99f851d 100644
17
42
{NULL, false}
18
43
};
19
44
diff --git a/src/backend/storage/file/copydir.c b/src/backend/storage/file/copydir.c
20
- index d4fbe542077..b108416c708 100644
45
+ index d4fbe54207..b108416c70 100644
21
46
--- a/src/backend/storage/file/copydir.c
22
47
+++ b/src/backend/storage/file/copydir.c
23
48
@@ -27,6 +27,8 @@
@@ -40,7 +65,7 @@ index d4fbe542077..b108416c708 100644
40
65
* Be paranoid here and fsync all files to ensure the copy is really done.
41
66
* But if fsync is disabled, we're done.
42
67
diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c
43
- index bf0f3ca76d1..7d9833a3604 100644
68
+ index bf0f3ca76d..7d9833a360 100644
44
69
--- a/src/backend/storage/smgr/md.c
45
70
+++ b/src/backend/storage/smgr/md.c
46
71
@@ -85,6 +85,8 @@ typedef struct _MdfdVec
@@ -92,7 +117,7 @@ index bf0f3ca76d1..7d9833a3604 100644
92
117
}
93
118
94
119
diff --git a/src/backend/storage/sync/sync.c b/src/backend/storage/sync/sync.c
95
- index ab7137d0fff..bc40a763c05 100644
120
+ index ab7137d0ff..bc40a763c0 100644
96
121
--- a/src/backend/storage/sync/sync.c
97
122
+++ b/src/backend/storage/sync/sync.c
98
123
@@ -74,6 +74,8 @@ static MemoryContext pendingOpsCxt; /* context for the above */
@@ -115,7 +140,7 @@ index ab7137d0fff..bc40a763c05 100644
115
140
sync_in_progress = false;
116
141
}
117
142
diff --git a/src/bin/pg_checksums/pg_checksums.c b/src/bin/pg_checksums/pg_checksums.c
118
- index 9e6fd435f60..f2180b9f6de 100644
143
+ index 9e6fd435f6..f2180b9f6d 100644
119
144
--- a/src/bin/pg_checksums/pg_checksums.c
120
145
+++ b/src/bin/pg_checksums/pg_checksums.c
121
146
@@ -110,6 +110,11 @@ static const struct exclude_list_item skip[] = {
@@ -131,7 +156,7 @@ index 9e6fd435f60..f2180b9f6de 100644
131
156
{"config_exec_params", true},
132
157
#endif
133
158
diff --git a/src/bin/pg_resetwal/pg_resetwal.c b/src/bin/pg_resetwal/pg_resetwal.c
134
- index e9dcb5a6d89..844b04d5e12 100644
159
+ index e9dcb5a6d8..844b04d5e1 100644
135
160
--- a/src/bin/pg_resetwal/pg_resetwal.c
136
161
+++ b/src/bin/pg_resetwal/pg_resetwal.c
137
162
@@ -86,6 +86,7 @@ static void FindEndOfXLOG(void);
@@ -193,10 +218,10 @@ index e9dcb5a6d89..844b04d5e12 100644
193
218
/*
194
219
* Remove existing archive status files
195
220
diff --git a/src/bin/pg_rewind/filemap.c b/src/bin/pg_rewind/filemap.c
196
- index 255ddf2ffaf..1142c244926 100644
221
+ index 4458324c9d..7d857467f7 100644
197
222
--- a/src/bin/pg_rewind/filemap.c
198
223
+++ b/src/bin/pg_rewind/filemap.c
199
- @@ -157 ,6 +157 ,10 @@ static const struct exclude_list_item excludeFiles[] =
224
+ @@ -156 ,6 +156 ,10 @@ static const struct exclude_list_item excludeFiles[] =
200
225
{"postmaster.pid", false},
201
226
{"postmaster.opts", false},
202
227
@@ -207,8 +232,22 @@ index 255ddf2ffaf..1142c244926 100644
207
232
/* end of list */
208
233
{NULL, false}
209
234
};
235
+ diff --git a/src/include/access/xlog.h b/src/include/access/xlog.h
236
+ index 76787a8267..2c662f4022 100644
237
+ --- a/src/include/access/xlog.h
238
+ +++ b/src/include/access/xlog.h
239
+ @@ -57,6 +57,9 @@ extern PGDLLIMPORT int wal_decode_buffer_size;
240
+
241
+ extern PGDLLIMPORT int CheckPointSegments;
242
+
243
+ + typedef void (*backup_checkpoint_request_hook_type) (void);
244
+ + extern PGDLLIMPORT backup_checkpoint_request_hook_type backup_checkpoint_request_hook;
245
+ +
246
+ /* Archive modes */
247
+ typedef enum ArchiveMode
248
+ {
210
249
diff --git a/src/include/storage/copydir.h b/src/include/storage/copydir.h
211
- index a25e258f479..b20b9c76e8d 100644
250
+ index a25e258f47..b20b9c76e8 100644
212
251
--- a/src/include/storage/copydir.h
213
252
+++ b/src/include/storage/copydir.h
214
253
@@ -13,6 +13,9 @@
@@ -222,7 +261,7 @@ index a25e258f479..b20b9c76e8d 100644
222
261
extern void copy_file(const char *fromfile, const char *tofile);
223
262
224
263
diff --git a/src/include/storage/md.h b/src/include/storage/md.h
225
- index 620f10abdeb..b36936871bd 100644
264
+ index 620f10abde..b36936871b 100644
226
265
--- a/src/include/storage/md.h
227
266
+++ b/src/include/storage/md.h
228
267
@@ -19,6 +19,13 @@
@@ -240,7 +279,7 @@ index 620f10abdeb..b36936871bd 100644
240
279
extern void mdinit(void);
241
280
extern void mdopen(SMgrRelation reln);
242
281
diff --git a/src/include/storage/sync.h b/src/include/storage/sync.h
243
- index 9dee8fa6e5b..348ed53e4e2 100644
282
+ index 9dee8fa6e5..348ed53e4e 100644
244
283
--- a/src/include/storage/sync.h
245
284
+++ b/src/include/storage/sync.h
246
285
@@ -55,6 +55,9 @@ typedef struct FileTag
0 commit comments