forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit357012e
committed
In successful pg_recvlogical, end PGRES_COPY_OUT cleanly.
pg_recvlogical merely called PQfinish(), so the backend sent messagesafter the disconnect. When that caused EPIPE in internal_flush(),before a LogicalConfirmReceivedLocation(), the next pg_recvlogical wouldrepeat already-acknowledged records. Whether or not the defect causesEPIPE, post-disconnect messages could contain an ErrorResponse that theuser should see. One properly ends PGRES_COPY_OUT by repeatingPQgetCopyData() until it returns a negative value. Augment one of thetests to cover the case of WAL past --endpos. Back-patch to v10, wherecommit7c03078 first appeared. Beforethat commit, pg_recvlogical never reached PGRES_COPY_OUT.Reported by Thomas Munro.Discussion:https://postgr.es/m/CAEepm=1MzM2Z_xNe4foGwZ1a+MO_2S9oYDq3M5D11=JDU_+0Nw@mail.gmail.com1 parentd439e27 commit357012e
File tree
2 files changed
+36
-5
lines changed- src
- bin/pg_basebackup
- test/recovery/t
2 files changed
+36
-5
lines changedLines changed: 30 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
605 | 605 |
| |
606 | 606 |
| |
607 | 607 |
| |
| 608 | + | |
| 609 | + | |
608 | 610 |
| |
609 | 611 |
| |
610 |
| - | |
611 |
| - | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
612 | 617 |
| |
613 |
| - | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
614 | 640 |
| |
615 |
| - | |
| 641 | + | |
616 | 642 |
| |
617 | 643 |
| |
618 | 644 |
| |
|
Lines changed: 6 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
71 | 71 |
| |
72 | 72 |
| |
73 | 73 |
| |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
74 | 79 |
| |
75 | 80 |
| |
76 | 81 |
| |
| |||
89 | 94 |
| |
90 | 95 |
| |
91 | 96 |
| |
92 |
| - | |
| 97 | + | |
93 | 98 |
| |
94 | 99 |
| |
95 | 100 |
| |
|
0 commit comments
Comments
(0)