forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc6d33d1
committed
Fix handling of missing files when using pg_rewind with online source
When working with an online source cluster, pg_rewind gets a list of allthe files in the source data directory using a WITH RECURSIVE query,returning a NULL result for a file's metadata if it gets removed betweenthe moment it is listed in a directory and the moment its metadata isobtained with pg_stat_file() (say a recycled WAL segment). The queryresult was processed in such a way that for each tuple we checked onlythat the first file's metadata was NULL. This could have twoconsequences, both resulting in a failure of the rewind:- If the first tuple referred to a removed file, all files from thesource would be ignored.- Any file actually missing would not be considered as such.While on it, rework slightly the code so as no values are saved if weknow that a file is going to be skipped.Issue introduced byb36805f, so backpatch down to 9.5.Author: Justin Pryzby, Michael PaquierReviewed-by: Daniel Gustafsson, Masahiko SawadaDiscussion:https://postgr.es/m/20200713061010.GC23581@telsasoft.comBackpatch-through: 9.51 parente9f0311 commitc6d33d1
1 file changed
+10
-5
lines changedLines changed: 10 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
216 | 216 |
| |
217 | 217 |
| |
218 | 218 |
| |
219 |
| - | |
220 |
| - | |
221 |
| - | |
222 |
| - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
223 | 223 |
| |
224 | 224 |
| |
225 |
| - | |
| 225 | + | |
226 | 226 |
| |
227 | 227 |
| |
228 | 228 |
| |
| |||
231 | 231 |
| |
232 | 232 |
| |
233 | 233 |
| |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
234 | 239 |
| |
235 | 240 |
| |
236 | 241 |
| |
|
0 commit comments
Comments
(0)