Skip to content

Commit b2cc5b8

Browse files
author
Amit Kapila
committed
Remove the streaming files for incomplete xacts after restart.
After restart, we try to stream the changes for large transactions that were not sent before server crash and restart. However, we forget to send the abort message for such transactions. This leads to spurious streaming files on the subscriber which won't be cleaned till the apply worker or the subscriber server restarts. Reported-by: Dilip Kumar Author: Hou Zhijie Reviewed-by: Dilip Kumar and Amit Kapila Backpatch-through: 14 Discussion: https://postgr.es/m/OS0PR01MB5716A773F46768A1B75BE24394FB9@OS0PR01MB5716.jpnprd01.prod.outlook.com
1 parent 48599a1 commit b2cc5b8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/backend/replication/logical/reorderbuffer.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2898,6 +2898,10 @@ ReorderBufferAbortOld(ReorderBuffer *rb, TransactionId oldestRunningXid)
28982898
{
28992899
elog(DEBUG2, "aborting old transaction %u", txn->xid);
29002900

2901+
/* Notify the remote node about the crash/immediate restart. */
2902+
if (rbtxn_is_streamed(txn))
2903+
rb->stream_abort(rb, txn, InvalidXLogRecPtr);
2904+
29012905
/* remove potential on-disk data, and deallocate this tx */
29022906
ReorderBufferCleanupTXN(rb, txn);
29032907
}

0 commit comments

Comments
 (0)