forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2ffa66f
committed
Fix walsender failure at promotion.
If a standby server has a cascading standby server connected to it, it'spossible that WAL has already been sent up to the next WAL page boundary,splitting a WAL record in the middle, when the first standby server ispromoted. Don't throw an assertion failure or error in walsender if thathappens.Also, fix a variant of the same bug in pg_receivexlog: if it had alreadyreceived WAL on previous timeline up to a segment boundary, when theupstream standby server is promoted so that the timeline switch record fallson the previous segment, pg_receivexlog would miss the segment containingthe timeline switch. To fix that, have walsender send the position of thetimeline switch at end-of-streaming, in addition to the next timeline's ID.It was previously assumed that the switch happened exactly where thestreaming stopped.Note: this is an incompatible change in the streaming protocol. You mightget an error if you try to stream over timeline switches, if the client isrunning 9.3beta1 and the server is more recent. It should be fine after areconnect, however.Reported by Fujii Masao.1 parentcb953d8 commit2ffa66f
File tree
7 files changed
+142
-43
lines changed- doc/src/sgml
- src
- backend
- access/transam
- replication
- libpqwalreceiver
- bin/pg_basebackup
7 files changed
+142
-43
lines changedLines changed: 9 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1423 | 1423 |
| |
1424 | 1424 |
| |
1425 | 1425 |
| |
1426 |
| - | |
1427 |
| - | |
1428 |
| - | |
1429 |
| - | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
1430 | 1435 |
| |
1431 | 1436 |
| |
1432 | 1437 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9598 | 9598 |
| |
9599 | 9599 |
| |
9600 | 9600 |
| |
9601 |
| - | |
| 9601 | + | |
9602 | 9602 |
| |
9603 | 9603 |
| |
9604 | 9604 |
| |
| |||
9607 | 9607 |
| |
9608 | 9608 |
| |
9609 | 9609 |
| |
9610 |
| - | |
| 9610 | + | |
| 9611 | + | |
9611 | 9612 |
| |
9612 | 9613 |
| |
9613 | 9614 |
| |
|
Lines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
224 | 224 |
| |
225 | 225 |
| |
226 | 226 |
| |
227 |
| - | |
228 |
| - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
229 | 232 |
| |
230 | 233 |
| |
231 | 234 |
| |
|
Lines changed: 4 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
260 | 260 |
| |
261 | 261 |
| |
262 | 262 |
| |
263 |
| - | |
264 |
| - | |
| 263 | + | |
| 264 | + | |
265 | 265 |
| |
266 |
| - | |
| 266 | + | |
267 | 267 |
| |
268 | 268 |
| |
| 269 | + | |
269 | 270 |
| |
270 | 271 |
| |
271 | 272 |
| |
|
Lines changed: 41 additions & 19 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
567 | 567 |
| |
568 | 568 |
| |
569 | 569 |
| |
570 |
| - | |
571 |
| - | |
| 570 | + | |
| 571 | + | |
572 | 572 |
| |
573 |
| - | |
574 |
| - | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
575 | 580 |
| |
576 | 581 |
| |
577 | 582 |
| |
578 |
| - | |
579 |
| - | |
| 583 | + | |
| 584 | + | |
580 | 585 |
| |
581 | 586 |
| |
582 | 587 |
| |
| |||
585 | 590 |
| |
586 | 591 |
| |
587 | 592 |
| |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
588 | 601 |
| |
589 | 602 |
| |
590 | 603 |
| |
591 | 604 |
| |
592 |
| - | |
593 |
| - | |
594 |
| - | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
595 | 613 |
| |
596 | 614 |
| |
597 | 615 |
| |
| |||
1462 | 1480 |
| |
1463 | 1481 |
| |
1464 | 1482 |
| |
1465 |
| - | |
| 1483 | + | |
1466 | 1484 |
| |
1467 | 1485 |
| |
1468 | 1486 |
| |
1469 |
| - | |
1470 |
| - | |
1471 |
| - | |
1472 |
| - | |
1473 |
| - | |
1474 |
| - | |
1475 |
| - | |
1476 |
| - | |
1477 |
| - | |
1478 | 1487 |
| |
1479 | 1488 |
| |
1480 | 1489 |
| |
| |||
1498 | 1507 |
| |
1499 | 1508 |
| |
1500 | 1509 |
| |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
1501 | 1519 |
| |
1502 | 1520 |
| |
1503 | 1521 |
| |
| |||
1511 | 1529 |
| |
1512 | 1530 |
| |
1513 | 1531 |
| |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
1514 | 1536 |
| |
1515 | 1537 |
| |
1516 | 1538 |
| |
|
Lines changed: 6 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
83 | 83 |
| |
84 | 84 |
| |
85 | 85 |
| |
86 |
| - | |
87 |
| - | |
88 |
| - | |
89 |
| - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
90 | 92 |
| |
91 | 93 |
| |
92 | 94 |
| |
|
Lines changed: 74 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
| 40 | + | |
| 41 | + | |
| 42 | + | |
40 | 43 |
| |
41 | 44 |
| |
42 | 45 |
| |
| |||
627 | 630 |
| |
628 | 631 |
| |
629 | 632 |
| |
630 |
| - | |
631 |
| - | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
632 | 636 |
| |
633 |
| - | |
634 | 637 |
| |
635 | 638 |
| |
636 | 639 |
| |
637 |
| - | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
638 | 647 |
| |
639 | 648 |
| |
| 649 | + | |
640 | 650 |
| |
641 |
| - | |
| 651 | + | |
642 | 652 |
| |
| 653 | + | |
| 654 | + | |
643 | 655 |
| |
| 656 | + | |
644 | 657 |
| |
645 | 658 |
| |
646 |
| - | |
647 | 659 |
| |
648 |
| - | |
649 |
| - | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
650 | 671 |
| |
651 | 672 |
| |
652 | 673 |
| |
| |||
666 | 687 |
| |
667 | 688 |
| |
668 | 689 |
| |
669 |
| - | |
| 690 | + | |
670 | 691 |
| |
671 | 692 |
| |
672 | 693 |
| |
| |||
704 | 725 |
| |
705 | 726 |
| |
706 | 727 |
| |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
707 | 772 |
| |
708 | 773 |
| |
709 | 774 |
| |
|
0 commit comments
Comments
(0)