- Notifications
You must be signed in to change notification settings - Fork5
Commit60df192
committed
Keep timeline history files restored from archive in pg_xlog.
The cascading standby patch in 9.2 changed the way WAL files are treatedwhen restored from the archive. Before, they were restored under a temporaryfilename, and not kept in pg_xlog, but after the patch, they were copiedunder pg_xlog. This is necessary for a cascading standby to find them, butit also means that if the archive goes offline and a standby is restarted,it can recover back to where it was using the files in pg_xlog. It alsomeans that if you take an offline backup from a standby server, it includesall the required WAL files in pg_xlog.However, the same change was not made to timeline history files, so if theWAL segment containing the checkpoint record contains a timeline switch, youwill still get an error if you try to restart recovery without the archive,or recover from an offline backup taken from the standby.With this patch, timeline history files restored from archive are copiedinto pg_xlog like WAL files are, so that pg_xlog contains all the filesrequired to recover. This is a corner-case pre-existing issue in 9.2, buteven more important in master where it's possible for a standby to follow atimeline switch through streaming replication. To make that possible, thetimeline history files must be present in pg_xlog.1 parent103cc89 commit60df192
File tree
4 files changed
+88
-59
lines changed- src
- backend/access/transam
- include/access
4 files changed
+88
-59
lines changedLines changed: 10 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
59 | 59 |
| |
60 | 60 |
| |
61 | 61 |
| |
| 62 | + | |
62 | 63 |
| |
63 | 64 |
| |
64 | 65 |
| |
| |||
72 | 73 |
| |
73 | 74 |
| |
74 | 75 |
| |
75 |
| - | |
| 76 | + | |
| 77 | + | |
76 | 78 |
| |
77 | 79 |
| |
78 | 80 |
| |
| |||
165 | 167 |
| |
166 | 168 |
| |
167 | 169 |
| |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
168 | 177 |
| |
169 | 178 |
| |
170 | 179 |
| |
|
Lines changed: 2 additions & 58 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2626 | 2626 |
| |
2627 | 2627 |
| |
2628 | 2628 |
| |
2629 |
| - | |
2630 |
| - | |
2631 |
| - | |
2632 |
| - | |
2633 |
| - | |
2634 |
| - | |
2635 |
| - | |
2636 |
| - | |
2637 |
| - | |
2638 |
| - | |
2639 |
| - | |
2640 |
| - | |
2641 |
| - | |
2642 |
| - | |
2643 |
| - | |
2644 |
| - | |
2645 |
| - | |
2646 |
| - | |
2647 |
| - | |
2648 |
| - | |
2649 |
| - | |
2650 |
| - | |
2651 |
| - | |
2652 |
| - | |
2653 |
| - | |
2654 |
| - | |
2655 |
| - | |
2656 |
| - | |
2657 |
| - | |
2658 |
| - | |
2659 |
| - | |
2660 |
| - | |
2661 |
| - | |
2662 |
| - | |
2663 |
| - | |
2664 |
| - | |
2665 |
| - | |
2666 |
| - | |
2667 |
| - | |
2668 |
| - | |
2669 |
| - | |
2670 |
| - | |
2671 |
| - | |
2672 |
| - | |
2673 |
| - | |
2674 |
| - | |
| 2629 | + | |
2675 | 2630 |
| |
2676 | 2631 |
| |
2677 | 2632 |
| |
2678 | 2633 |
| |
2679 |
| - | |
2680 |
| - | |
2681 |
| - | |
2682 |
| - | |
2683 |
| - | |
2684 |
| - | |
2685 |
| - | |
2686 |
| - | |
2687 |
| - | |
2688 |
| - | |
2689 |
| - | |
2690 |
| - | |
| 2634 | + | |
2691 | 2635 |
| |
2692 | 2636 |
| |
2693 | 2637 |
| |
|
Lines changed: 75 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
| 27 | + | |
27 | 28 |
| |
28 | 29 |
| |
29 | 30 |
| |
| |||
416 | 417 |
| |
417 | 418 |
| |
418 | 419 |
| |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
419 | 494 |
| |
420 | 495 |
| |
421 | 496 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
265 | 265 |
| |
266 | 266 |
| |
267 | 267 |
| |
| 268 | + | |
268 | 269 |
| |
269 | 270 |
| |
270 | 271 |
| |
|
0 commit comments
Comments
(0)