forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8222a9d
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 parent4fa8bd3 commit8222a9d
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 | |
---|---|---|---|
| |||
580 | 580 |
| |
581 | 581 |
| |
582 | 582 |
| |
| 583 | + | |
| 584 | + | |
583 | 585 |
| |
584 | 586 |
| |
585 |
| - | |
586 |
| - | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
587 | 592 |
| |
588 |
| - | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
589 | 615 |
| |
590 |
| - | |
| 616 | + | |
591 | 617 |
| |
592 | 618 |
| |
593 | 619 |
| |
|
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)