1
1
diff --git a/src/backend/backup/basebackup.c b/src/backend/backup/basebackup.c
2
- index 45be21131c5..134e677f9d1 100644
2
+ index 5fbbe5ffd20..3c9b99f851d 100644
3
3
--- a/src/backend/backup/basebackup.c
4
4
+++ b/src/backend/backup/basebackup.c
5
- @@ -199 ,6 +199 ,13 @@ static const struct exclude_list_item excludeFiles[] =
5
+ @@ -220 ,6 +220 ,13 @@ static const struct exclude_list_item excludeFiles[] =
6
6
{"postmaster.pid", false},
7
7
{"postmaster.opts", false},
8
8
@@ -16,20 +16,8 @@ index 45be21131c5..134e677f9d1 100644
16
16
/* end of list */
17
17
{NULL, false}
18
18
};
19
- @@ -214,6 +221,11 @@ static const struct exclude_list_item noChecksumFiles[] = {
20
- {"pg_filenode.map", false},
21
- {"pg_internal.init", true},
22
- {"PG_VERSION", false},
23
- +
24
- + {"ptrack.map.mmap", false},
25
- + {"ptrack.map", false},
26
- + {"ptrack.map.tmp", false},
27
- +
28
- #ifdef EXEC_BACKEND
29
- {"config_exec_params", true},
30
- #endif
31
19
diff --git a/src/backend/storage/file/copydir.c b/src/backend/storage/file/copydir.c
32
- index e04bc3941ae..996b5de6169 100644
20
+ index d4fbe542077..b108416c708 100644
33
21
--- a/src/backend/storage/file/copydir.c
34
22
+++ b/src/backend/storage/file/copydir.c
35
23
@@ -27,6 +27,8 @@
@@ -52,10 +40,10 @@ index e04bc3941ae..996b5de6169 100644
52
40
* Be paranoid here and fsync all files to ensure the copy is really done.
53
41
* But if fsync is disabled, we're done.
54
42
diff --git a/src/backend/storage/smgr/md.c b/src/backend/storage/smgr/md.c
55
- index fdecbad1709..f849d00161e 100644
43
+ index bf0f3ca76d1..7d9833a3604 100644
56
44
--- a/src/backend/storage/smgr/md.c
57
45
+++ b/src/backend/storage/smgr/md.c
58
- @@ -87 ,6 +87 ,8 @@ typedef struct _MdfdVec
46
+ @@ -85 ,6 +85 ,8 @@ typedef struct _MdfdVec
59
47
60
48
static MemoryContext MdCxt; /* context for all MdfdVec objects */
61
49
@@ -64,7 +52,7 @@ index fdecbad1709..f849d00161e 100644
64
52
65
53
/* Populate a file tag describing an md.c segment file. */
66
54
#define INIT_MD_FILETAG(a,xx_rlocator,xx_forknum,xx_segno) \
67
- @@ -515 ,6 +517 ,9 @@ mdextend(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
55
+ @@ -513 ,6 +515 ,9 @@ mdextend(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
68
56
register_dirty_segment(reln, forknum, v);
69
57
70
58
Assert(_mdnblocks(reln, forknum, v) <= ((BlockNumber) RELSEG_SIZE));
@@ -74,7 +62,7 @@ index fdecbad1709..f849d00161e 100644
74
62
}
75
63
76
64
/*
77
- @@ -622 ,6 +627 ,12 @@ mdzeroextend(SMgrRelation reln, ForkNumber forknum,
65
+ @@ -620 ,6 +625 ,12 @@ mdzeroextend(SMgrRelation reln, ForkNumber forknum,
78
66
79
67
remblocks -= numblocks;
80
68
curblocknum += numblocks;
@@ -87,21 +75,27 @@ index fdecbad1709..f849d00161e 100644
87
75
}
88
76
}
89
77
90
- @@ -867,6 +878,9 @@ mdwrite (SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
78
+ @@ -1015,7 +1026,14 @@ mdwritev (SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
91
79
92
- if (!skipFsync && !SmgrIsTemp(reln))
93
- register_dirty_segment(reln, forknum, v);
80
+ nblocks -= nblocks_this_segment;
81
+ buffers += nblocks_this_segment;
82
+ - blocknum += nblocks_this_segment;
94
83
+
95
- + if (mdwrite_hook)
96
- + mdwrite_hook(reln->smgr_rlocator, forknum, blocknum);
84
+ + if (mdwrite_hook)
85
+ + {
86
+ + for (; nblocks_this_segment--; blocknum++)
87
+ + mdwrite_hook(reln->smgr_rlocator, forknum, blocknum);
88
+ + }
89
+ + else
90
+ + blocknum += nblocks_this_segment;
91
+ }
97
92
}
98
93
99
- /*
100
94
diff --git a/src/backend/storage/sync/sync.c b/src/backend/storage/sync/sync.c
101
- index 04fcb06056d..22bf179f560 100644
95
+ index ab7137d0fff..bc40a763c05 100644
102
96
--- a/src/backend/storage/sync/sync.c
103
97
+++ b/src/backend/storage/sync/sync.c
104
- @@ -79 ,6 +79 ,8 @@ static MemoryContext pendingOpsCxt; /* context for the above */
98
+ @@ -74 ,6 +74 ,8 @@ static MemoryContext pendingOpsCxt; /* context for the above */
105
99
static CycleCtr sync_cycle_ctr = 0;
106
100
static CycleCtr checkpoint_cycle_ctr = 0;
107
101
@@ -110,7 +104,7 @@ index 04fcb06056d..22bf179f560 100644
110
104
/* Intervals for calling AbsorbSyncRequests */
111
105
#define FSYNCS_PER_ABSORB 10
112
106
#define UNLINKS_PER_ABSORB 10
113
- @@ -475 ,6 +477 ,9 @@ ProcessSyncRequests(void)
107
+ @@ -470 ,6 +472 ,9 @@ ProcessSyncRequests(void)
114
108
CheckpointStats.ckpt_longest_sync = longest;
115
109
CheckpointStats.ckpt_agg_sync_time = total_elapsed;
116
110
@@ -121,10 +115,10 @@ index 04fcb06056d..22bf179f560 100644
121
115
sync_in_progress = false;
122
116
}
123
117
diff --git a/src/bin/pg_checksums/pg_checksums.c b/src/bin/pg_checksums/pg_checksums.c
124
- index 19eb67e4854..008a7acc9f0 100644
118
+ index 9e6fd435f60..f2180b9f6de 100644
125
119
--- a/src/bin/pg_checksums/pg_checksums.c
126
120
+++ b/src/bin/pg_checksums/pg_checksums.c
127
- @@ -118 ,6 +118 ,11 @@ static const struct exclude_list_item skip[] = {
121
+ @@ -110 ,6 +110 ,11 @@ static const struct exclude_list_item skip[] = {
128
122
{"pg_filenode.map", false},
129
123
{"pg_internal.init", true},
130
124
{"PG_VERSION", false},
@@ -137,27 +131,27 @@ index 19eb67e4854..008a7acc9f0 100644
137
131
{"config_exec_params", true},
138
132
#endif
139
133
diff --git a/src/bin/pg_resetwal/pg_resetwal.c b/src/bin/pg_resetwal/pg_resetwal.c
140
- index e7ef2b8bd0c..ca7f8cdbc2f 100644
134
+ index e9dcb5a6d89..844b04d5e12 100644
141
135
--- a/src/bin/pg_resetwal/pg_resetwal.c
142
136
+++ b/src/bin/pg_resetwal/pg_resetwal.c
143
- @@ -85,6 +85,7 @@ static void RewriteControlFile(void);
144
- static void FindEndOfXLOG(void);
137
+ @@ -86,6 +86,7 @@ static void FindEndOfXLOG(void);
145
138
static void KillExistingXLOG(void);
146
139
static void KillExistingArchiveStatus(void);
140
+ static void KillExistingWALSummaries(void);
147
141
+ static void KillExistingPtrack(void);
148
142
static void WriteEmptyXLOG(void);
149
143
static void usage(void);
150
144
151
- @@ -488,6 +489,7 @@ main(int argc, char *argv[])
152
- RewriteControlFile();
145
+ @@ -495,6 +496,7 @@ main(int argc, char *argv[])
153
146
KillExistingXLOG();
154
147
KillExistingArchiveStatus();
148
+ KillExistingWALSummaries();
155
149
+ KillExistingPtrack();
156
150
WriteEmptyXLOG();
157
151
158
152
printf(_("Write-ahead log reset\n"));
159
- @@ -1029 ,6 +1031 ,41 @@ KillExistingArchiveStatus (void)
160
- pg_fatal("could not close directory \"%s\": %m", ARCHSTATDIR );
153
+ @@ -998 ,6 +1000 ,41 @@ KillExistingXLOG (void)
154
+ pg_fatal("could not close directory \"%s\": %m", XLOGDIR );
161
155
}
162
156
163
157
+ /*
@@ -197,9 +191,9 @@ index e7ef2b8bd0c..ca7f8cdbc2f 100644
197
191
+
198
192
199
193
/*
200
- * Write an empty XLOG file, containing only the checkpoint record
194
+ * Remove existing archive status files
201
195
diff --git a/src/bin/pg_rewind/filemap.c b/src/bin/pg_rewind/filemap.c
202
- index bd5c598e200..a568156c5fb 100644
196
+ index 255ddf2ffaf..1142c244926 100644
203
197
--- a/src/bin/pg_rewind/filemap.c
204
198
+++ b/src/bin/pg_rewind/filemap.c
205
199
@@ -157,6 +157,10 @@ static const struct exclude_list_item excludeFiles[] =
@@ -214,7 +208,7 @@ index bd5c598e200..a568156c5fb 100644
214
208
{NULL, false}
215
209
};
216
210
diff --git a/src/include/storage/copydir.h b/src/include/storage/copydir.h
217
- index a8be5b21e0b..020874f96cd 100644
211
+ index a25e258f479..b20b9c76e8d 100644
218
212
--- a/src/include/storage/copydir.h
219
213
+++ b/src/include/storage/copydir.h
220
214
@@ -13,6 +13,9 @@
@@ -228,7 +222,7 @@ index a8be5b21e0b..020874f96cd 100644
228
222
extern void copy_file(const char *fromfile, const char *tofile);
229
223
230
224
diff --git a/src/include/storage/md.h b/src/include/storage/md.h
231
- index 941879ee6a8..24738aeecd0 100644
225
+ index 620f10abdeb..b36936871bd 100644
232
226
--- a/src/include/storage/md.h
233
227
+++ b/src/include/storage/md.h
234
228
@@ -19,6 +19,13 @@
@@ -246,11 +240,11 @@ index 941879ee6a8..24738aeecd0 100644
246
240
extern void mdinit(void);
247
241
extern void mdopen(SMgrRelation reln);
248
242
diff --git a/src/include/storage/sync.h b/src/include/storage/sync.h
249
- index cfbcfa6797d..2a432440db9 100644
243
+ index 9dee8fa6e5b..348ed53e4e2 100644
250
244
--- a/src/include/storage/sync.h
251
245
+++ b/src/include/storage/sync.h
252
246
@@ -55,6 +55,9 @@ typedef struct FileTag
253
- uint32 segno;
247
+ uint64 segno;
254
248
} FileTag;
255
249
256
250
+ typedef void (*ProcessSyncRequests_hook_type) (void);
0 commit comments