mirror of
https://github.com/postgres/postgres.git
synced 2026-07-10 02:01:05 -04:00
Previously, when pg_recvlogical exited due to SIGINT or SIGTERM, it could terminate without sending final feedback for the last decoded changes it had already written locally. So, if pg_recvlogical was restarted afterwards, the server-side logical replication slot could still point behind those changes, causing them to be sent again. Make pg_recvlogical send final feedback once more during SIGINT/SIGTERM shutdown, before sending CopyDone. This gives the server one more chance to advance the slot far enough to avoid resending already-written data, so users are less likely to see duplicate decoded output after stopping and restarting pg_recvlogical. This remains a best-effort improvement rather than a guarantee. Depending on when the signal arrives, pg_recvlogical can already have written decoded output that the server cannot yet safely treat as confirmed, so a later restart can still receive duplicate data. Author: Fujii Masao <masao.fujii@gmail.com> Reviewed-by: Ayush Tiwari <ayushtiwari.slg01@gmail.com> Discussion: https://postgr.es/m/CAHGQGwE83z9O=X7ADMsSa3e1EuP3_GgqHjFt5SmPDNxZo_wgJA@mail.gmail.com |
||
|---|---|---|
| .. | ||
| backend | ||
| bin | ||
| common | ||
| fe_utils | ||
| include | ||
| interfaces | ||
| makefiles | ||
| pl | ||
| port | ||
| template | ||
| test | ||
| timezone | ||
| tools | ||
| tutorial | ||
| .gitignore | ||
| DEVELOPERS | ||
| Makefile | ||
| Makefile.global.in | ||
| Makefile.shlib | ||
| meson.build | ||
| nls-global.mk | ||