Hi, I think we're missing some cleanup in pgoutput for streamed 2PC. We call cleanup_rel_sync_cache() on stream commit and abort, but not on COMMIT PREPARED or ROLLBACK PREPARED.
For streamed transactions, maybe_send_schema() records the top-level XID in each relation's streamed_txns list when it sends the schema. It looks like those entries are left behind after COMMIT PREPARED or ROLLBACK PREPARED, until the cache entry is rebuilt or the walsender exits. The attached patch adds the same cleanup to those two callbacks, guarded by rbtxn_is_streamed(txn). Is there a reason to keep these entries once the prepared transaction has finished? I tested both commit and rollback with a publisher/subscriber setup. The data matched, and I no longer saw the cache growth with the patch. Thoughts? Regards, Ayush
v1-0001-Clean-up-pgoutput-schema-cache-after-prepared-transactions.patch
Description: Binary data
