forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita46fe6e
committed
pg_rewind: Fix some problems when copying files >2GB.
When incrementally updating a file larger than 2GB, the old code couldeither fail outright (if the client asked the server for bytes beyondthe 2GB boundary) or fail to copy all the blocks that had actuallybeen modified (if the server reported a file size to the client inexcess of 2GB), resulting in data corruption. Generally, such fileswon't occur anyway, but they might if using a non-default segment sizeor if there the directory contains stray files unrelated toPostgreSQL. Fix by a more prudent choice of data types.Even with these improvements, this code still uses a mix of differenttypes (off_t, size_t, uint64, int64) to represent file sizes andoffsets, not all of which necessarily have the same width orsignedness, so further cleanup might be in order here. However, atleast now they all have the potential to be 64 bits wide on 64-bitplatforms.Kuntal Ghosh and Michael Paquier, with a tweak by me.Discussion:http://postgr.es/m/CAGz5QC+8gbkz=Brp0TgoKNqHWTzonbPtPex80U0O6Uh_bevbaA@mail.gmail.com1 parent88f48b5 commita46fe6e
1 file changed
+35
-12
lines changedLines changed: 35 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
194 | 194 |
| |
195 | 195 |
| |
196 | 196 |
| |
197 |
| - | |
| 197 | + | |
198 | 198 |
| |
199 | 199 |
| |
200 | 200 |
| |
| |||
220 | 220 |
| |
221 | 221 |
| |
222 | 222 |
| |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
223 | 245 |
| |
224 | 246 |
| |
225 | 247 |
| |
226 | 248 |
| |
227 | 249 |
| |
228 | 250 |
| |
229 |
| - | |
| 251 | + | |
230 | 252 |
| |
231 | 253 |
| |
232 | 254 |
| |
| |||
247 | 269 |
| |
248 | 270 |
| |
249 | 271 |
| |
250 |
| - | |
| 272 | + | |
251 | 273 |
| |
252 | 274 |
| |
253 | 275 |
| |
| |||
270 | 292 |
| |
271 | 293 |
| |
272 | 294 |
| |
273 |
| - | |
| 295 | + | |
274 | 296 |
| |
275 | 297 |
| |
276 | 298 |
| |
| |||
290 | 312 |
| |
291 | 313 |
| |
292 | 314 |
| |
293 |
| - | |
| 315 | + | |
294 | 316 |
| |
295 | 317 |
| |
296 | 318 |
| |
297 |
| - | |
298 |
| - | |
| 319 | + | |
| 320 | + | |
299 | 321 |
| |
300 | 322 |
| |
301 | 323 |
| |
| |||
320 | 342 |
| |
321 | 343 |
| |
322 | 344 |
| |
323 |
| - | |
| 345 | + | |
324 | 346 |
| |
325 | 347 |
| |
326 | 348 |
| |
| |||
380 | 402 |
| |
381 | 403 |
| |
382 | 404 |
| |
383 |
| - | |
| 405 | + | |
384 | 406 |
| |
385 | 407 |
| |
386 | 408 |
| |
| |||
389 | 411 |
| |
390 | 412 |
| |
391 | 413 |
| |
| 414 | + | |
392 | 415 |
| |
393 | 416 |
| |
394 | 417 |
| |
395 |
| - | |
| 418 | + | |
396 | 419 |
| |
397 |
| - | |
| 420 | + | |
398 | 421 |
| |
399 | 422 |
| |
400 | 423 |
| |
| |||
419 | 442 |
| |
420 | 443 |
| |
421 | 444 |
| |
422 |
| - | |
| 445 | + | |
423 | 446 |
| |
424 | 447 |
| |
425 | 448 |
| |
|
0 commit comments
Comments
(0)