forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1d09fb1
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 parente949137 commit1d09fb1
1 file changed
+10
-5
lines changedLines changed: 10 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
214 | 214 |
| |
215 | 215 |
| |
216 | 216 |
| |
217 |
| - | |
218 |
| - | |
219 |
| - | |
220 |
| - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
221 | 221 |
| |
222 | 222 |
| |
223 |
| - | |
| 223 | + | |
224 | 224 |
| |
225 | 225 |
| |
226 | 226 |
| |
| |||
229 | 229 |
| |
230 | 230 |
| |
231 | 231 |
| |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
232 | 237 |
| |
233 | 238 |
| |
234 | 239 |
| |
|
0 commit comments
Comments
(0)