Skip to content

Commit f062089

Browse files
Amit Kapilapull[bot]
authored andcommitted
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 1985b6e commit f062089

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
@@ -2936,6 +2936,10 @@ ReorderBufferAbortOld(ReorderBuffer *rb, TransactionId oldestRunningXid)
29362936
{
29372937
elog(DEBUG2, "aborting old transaction %u", txn->xid);
29382938

2939+
/* Notify the remote node about the crash/immediate restart. */
2940+
if (rbtxn_is_streamed(txn))
2941+
rb->stream_abort(rb, txn, InvalidXLogRecPtr);
2942+
29392943
/* remove potential on-disk data, and deallocate this tx */
29402944
ReorderBufferCleanupTXN(rb, txn);
29412945
}

0 commit comments

Comments
 (0)