Fix walsender error cleanup code
Alvaro Herrera <alvherre@alvh.no-ip.org>
Fix walsender error cleanup code In commit 850196b610d2 I (Álvaro) failed to handle the case of walsender shutting down on an error before setting up its 'xlogreader' pointer; the error handling code dereferences the pointer, causing a crash. Fix by testing the pointer before trying to dereference it. Kyotaro authored the code fix; I adopted Nathan's test case to be used by the TAP tests and added the necessary PostgresNode change. Reported-by: Nathan Bossart <bossartn@amazon.com> Author: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Author: Álvaro Herrera <alvherre@alvh.no-ip.org> Discussion: https://postgr.es/m/C04FC24E-903D-4423-B312-6910E4D846E5@amazon.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/replication/walsender.c | modified | +1 −1 |
| src/test/perl/PostgresNode.pm | modified | +15 −2 |
| src/test/recovery/t/006_logical_decoding.pl | modified | +11 −2 |
Discussion
- pg13: xlogreader API adjust 11 messages · 2020-05-11 → 2020-05-21