We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent215d047 commit1b776d5Copy full SHA for 1b776d5
contrib/test_decoding/test_decoding.c
@@ -311,6 +311,17 @@ pg_filter_prepare(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
311
/*
312
* For the sake of simplicity we just ignore in-progess transaction
313
* in this extension, as they may abort during deconing.
314
+ *
315
+ * It is possible to move that LWLockRelease() to pg_decode_prepare_txn()
316
+ * and allow decoding of running prepared tx, but such lock will prevent
317
+ * any 2pc transaction commit during decoding time, that can be big
318
+ * enough in case of massive changes/inserts in that tx.
319
320
+ * Better solution would be to use own custom lock here and register
321
+ * XACT_EVENT_PRE_COMMIT callback in extension to conflict with this
322
+ * lock. Decode should hold it in shared way, while commit in excluseve.
323
+ * That will allow to lock stuff granularly ang block only tx that is
324
+ * being decoded.
325
*/
326
LWLockRelease(TwoPhaseStateLock);
327
return true;