Bug reference: 14279
Logged by: Marko Tiikkaja
Email address: ma...@joh.to
PostgreSQL version: 9.5.3
Operating system: Linux
Description:
Hi,
The following transaction does not get decoded at all in logical decoding:
BEGIN;
INSERT INTO foo VALUES ('bar');
SAVEPOINT s;
SELECT 1 FROM foo FOR UPDATE;
RELEASE SAVEPOINT s;
COMMIT;
The problem seems to be that ReorderBufferCommitChild() overwrites the main
transaction's base_snapshot with a NULL because it thinks the
subtransaction's base_snapshot_lsn=0 is older than the main transaction's
actual snapshot, which in ReorderBufferCommit:
/*
* If this transaction didn't have any real changes in our database,
it's
* OK not to have a snapshot. Note that ReorderBufferCommitChild will
have
* transferred its snapshot to this transaction if it had one and the
* toplevel tx didn't.
*/
if (txn->base_snapshot == NULL)
{
Assert(txn->ninvalidations == 0);
ReorderBufferCleanupTXN(rb, txn);
return;
}
causes the entire transaction to be skipped. I didn't debug further.
(Thanks to Andres Freund and Andrew Gierth for helping me track this problem
down!)
--
Sent via pgsql-bugs mailing list (pgsql...@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs