- Notifications
You must be signed in to change notification settings - Fork5
Commitb882246
committed
Fix two timeline handling bugs in pg_receivexlog.
When a timeline history file is fetched from server, it is initially createdwith a temporary file name, and renamed to place. However, the temporaryfile name was constructed using an uninitialized buffer. Usually that meantthat the file was created in current directory instead of the target, whichusually goes unnoticed, but if the target is on a different filesystem thanthe current dir, the rename() would fail. Fix that.The second issue is that pg_receivexlog would not take .partial files intoaccount when determining when scanning the target directory for existingWAL files. If the timeline has switched in the server several times in thelast WAL segment, and pg_receivexlog is restarted, it would choose a tooold starting point. That's not a problem as long as the old WAL segmentexists in the server and can be streamed over, but will cause a failure ifit's not.Backpatch to 9.3, where this timeline handling code was written.Analysed by Andrew Gierth, bug #8453, based on a bug report on IRC.1 parent496439d commitb882246
2 files changed
+52
-29
lines changedLines changed: 49 additions & 25 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
121 | 121 |
| |
122 | 122 |
| |
123 | 123 |
| |
| 124 | + | |
124 | 125 |
| |
125 | 126 |
| |
126 | 127 |
| |
| |||
132 | 133 |
| |
133 | 134 |
| |
134 | 135 |
| |
135 |
| - | |
136 |
| - | |
137 | 136 |
| |
138 | 137 |
| |
139 | 138 |
| |
140 | 139 |
| |
| 140 | + | |
141 | 141 |
| |
142 | 142 |
| |
143 | 143 |
| |
144 | 144 |
| |
145 | 145 |
| |
146 | 146 |
| |
147 |
| - | |
148 |
| - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
149 | 162 |
| |
150 | 163 |
| |
151 | 164 |
| |
| |||
160 | 173 |
| |
161 | 174 |
| |
162 | 175 |
| |
163 |
| - | |
164 |
| - | |
165 |
| - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
166 | 181 |
| |
167 |
| - | |
168 |
| - | |
169 |
| - | |
170 |
| - | |
| 182 | + | |
| 183 | + | |
171 | 184 |
| |
172 |
| - | |
173 |
| - | |
174 |
| - | |
175 |
| - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
176 | 194 |
| |
177 |
| - | |
178 |
| - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
179 | 198 |
| |
180 | 199 |
| |
181 | 200 |
| |
182 |
| - | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
183 | 206 |
| |
184 |
| - | |
185 |
| - | |
186 |
| - | |
187 |
| - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
188 | 210 |
| |
189 | 211 |
| |
190 | 212 |
| |
| |||
195 | 217 |
| |
196 | 218 |
| |
197 | 219 |
| |
198 |
| - | |
199 |
| - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
200 | 223 |
| |
201 |
| - | |
| 224 | + | |
| 225 | + | |
202 | 226 |
| |
203 | 227 |
| |
204 | 228 |
| |
|
Lines changed: 3 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
166 | 166 |
| |
167 | 167 |
| |
168 | 168 |
| |
169 |
| - | |
170 |
| - | |
| 169 | + | |
171 | 170 |
| |
172 | 171 |
| |
173 | 172 |
| |
| |||
306 | 305 |
| |
307 | 306 |
| |
308 | 307 |
| |
| 308 | + | |
| 309 | + | |
309 | 310 |
| |
310 | 311 |
| |
311 | 312 |
| |
| |||
356 | 357 |
| |
357 | 358 |
| |
358 | 359 |
| |
359 |
| - | |
360 |
| - | |
361 | 360 |
| |
362 | 361 |
| |
363 | 362 |
| |
|
0 commit comments
Comments
(0)