pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: In successful pg_recvlogical, end PGRES_COPY_OUT cleanly. 4+ messages / 1 participants [nested] [flat]
* pgsql: In successful pg_recvlogical, end PGRES_COPY_OUT cleanly. @ 2020-05-14 03:44 Noah Misch <noah@leadboat.com> 0 siblings, 0 replies; 4+ messages in thread From: Noah Misch @ 2020-05-14 03:44 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org In successful pg_recvlogical, end PGRES_COPY_OUT cleanly. pg_recvlogical merely called PQfinish(), so the backend sent messages after the disconnect. When that caused EPIPE in internal_flush(), before a LogicalConfirmReceivedLocation(), the next pg_recvlogical would repeat already-acknowledged records. Whether or not the defect causes EPIPE, post-disconnect messages could contain an ErrorResponse that the user should see. One properly ends PGRES_COPY_OUT by repeating PQgetCopyData() until it returns a negative value. Augment one of the tests to cover the case of WAL past --endpos. Back-patch to v10, where commit 7c030783a5bd07cadffc2a1018bc33119a4c7505 first appeared. Before that 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.com Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/357012e17f3f7d47bd276d4441c28fbcd58a2c8b Modified Files -------------- src/bin/pg_basebackup/pg_recvlogical.c | 34 +++++++++++++++++++++++++---- src/test/recovery/t/006_logical_decoding.pl | 7 +++++- 2 files changed, 36 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: In successful pg_recvlogical, end PGRES_COPY_OUT cleanly. @ 2020-05-14 03:44 Noah Misch <noah@leadboat.com> 0 siblings, 0 replies; 4+ messages in thread From: Noah Misch @ 2020-05-14 03:44 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org In successful pg_recvlogical, end PGRES_COPY_OUT cleanly. pg_recvlogical merely called PQfinish(), so the backend sent messages after the disconnect. When that caused EPIPE in internal_flush(), before a LogicalConfirmReceivedLocation(), the next pg_recvlogical would repeat already-acknowledged records. Whether or not the defect causes EPIPE, post-disconnect messages could contain an ErrorResponse that the user should see. One properly ends PGRES_COPY_OUT by repeating PQgetCopyData() until it returns a negative value. Augment one of the tests to cover the case of WAL past --endpos. Back-patch to v10, where commit 7c030783a5bd07cadffc2a1018bc33119a4c7505 first appeared. Before that 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.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/8222a9d9a12356349114ec275b01a1a58da2b941 Modified Files -------------- src/bin/pg_basebackup/pg_recvlogical.c | 34 +++++++++++++++++++++++++---- src/test/recovery/t/006_logical_decoding.pl | 7 +++++- 2 files changed, 36 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: In successful pg_recvlogical, end PGRES_COPY_OUT cleanly. @ 2020-05-14 03:44 Noah Misch <noah@leadboat.com> 0 siblings, 0 replies; 4+ messages in thread From: Noah Misch @ 2020-05-14 03:44 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org In successful pg_recvlogical, end PGRES_COPY_OUT cleanly. pg_recvlogical merely called PQfinish(), so the backend sent messages after the disconnect. When that caused EPIPE in internal_flush(), before a LogicalConfirmReceivedLocation(), the next pg_recvlogical would repeat already-acknowledged records. Whether or not the defect causes EPIPE, post-disconnect messages could contain an ErrorResponse that the user should see. One properly ends PGRES_COPY_OUT by repeating PQgetCopyData() until it returns a negative value. Augment one of the tests to cover the case of WAL past --endpos. Back-patch to v10, where commit 7c030783a5bd07cadffc2a1018bc33119a4c7505 first appeared. Before that 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.com Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/a28db2081d4d879638f23053f1de67a0fa3e46f0 Modified Files -------------- src/bin/pg_basebackup/pg_recvlogical.c | 34 +++++++++++++++++++++++++---- src/test/recovery/t/006_logical_decoding.pl | 7 +++++- 2 files changed, 36 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: In successful pg_recvlogical, end PGRES_COPY_OUT cleanly. @ 2020-05-14 03:44 Noah Misch <noah@leadboat.com> 0 siblings, 0 replies; 4+ messages in thread From: Noah Misch @ 2020-05-14 03:44 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org In successful pg_recvlogical, end PGRES_COPY_OUT cleanly. pg_recvlogical merely called PQfinish(), so the backend sent messages after the disconnect. When that caused EPIPE in internal_flush(), before a LogicalConfirmReceivedLocation(), the next pg_recvlogical would repeat already-acknowledged records. Whether or not the defect causes EPIPE, post-disconnect messages could contain an ErrorResponse that the user should see. One properly ends PGRES_COPY_OUT by repeating PQgetCopyData() until it returns a negative value. Augment one of the tests to cover the case of WAL past --endpos. Back-patch to v10, where commit 7c030783a5bd07cadffc2a1018bc33119a4c7505 first appeared. Before that 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.com Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/7130be8aa3e022b08245f77cbbe5a71473b36a73 Modified Files -------------- src/bin/pg_basebackup/pg_recvlogical.c | 34 +++++++++++++++++++++++++---- src/test/recovery/t/006_logical_decoding.pl | 7 +++++- 2 files changed, 36 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2020-05-14 03:44 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-05-14 03:44 pgsql: In successful pg_recvlogical, end PGRES_COPY_OUT cleanly. Noah Misch <noah@leadboat.com> 2020-05-14 03:44 pgsql: In successful pg_recvlogical, end PGRES_COPY_OUT cleanly. Noah Misch <noah@leadboat.com> 2020-05-14 03:44 pgsql: In successful pg_recvlogical, end PGRES_COPY_OUT cleanly. Noah Misch <noah@leadboat.com> 2020-05-14 03:44 pgsql: In successful pg_recvlogical, end PGRES_COPY_OUT cleanly. Noah Misch <noah@leadboat.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox