forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit23924fe
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 parent4e02f88 commit23924fe
1 file changed
+10
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
| 229 | + | |
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
238 | 243 | | |
239 | 244 | | |
240 | 245 | | |
| |||
0 commit comments
Comments
(0)