Don't advance origin during apply failure.
Amit Kapila <akapila@postgresql.org>
Don't advance origin during apply failure. We advance origin progress during abort on successful streaming and application of ROLLBACK in parallel streaming mode. But the origin shouldn't be advanced during an error or unsuccessful apply due to shutdown. Otherwise, it will result in a transaction loss as such a transaction won't be sent again by the server. Reported-by: Hou Zhijie Author: Hayato Kuroda and Shveta Malik Reviewed-by: Amit Kapila Backpatch-through: 16 Discussion: https://postgr.es/m/TYAPR01MB5692FAC23BE40C69DA8ED4AFF5B92@TYAPR01MB5692.jpnprd01.prod.outlook.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/replication/logical/worker.c | modified | +35 −0 |
| src/backend/utils/error/elog.c | modified | +17 −0 |
| src/include/utils/elog.h | modified | +1 −0 |
| src/test/subscription/t/021_twophase.pl | modified | +13 −1 |
Discussion
- [bug fix] prepared transaction might be lost when max_prepared_transactions is zero on the subscriber 24 messages · 2024-08-08 → 2025-12-24