Rework subtransaction commit protocol for hot standby.
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 20 Oct 2008 19:18:18 +0000 (19:18 +0000)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 20 Oct 2008 19:18:18 +0000 (19:18 +0000)
commit32398ddd13abc1c316cceb363c89c4a157385db2
tree0b8676d14abc435fa8d876ba0e83a4b269a35d4c
parent34cc96998f4889bfdd46a7f5c9c4b0f16a71defa
Rework subtransaction commit protocol for hot standby.

This patch eliminates the marking of subtransactions as SUBCOMMITTED in pg_clog
during their commit; instead they remain in-progress until main transaction
commit.  At main transaction commit, the commit protocol is atomic-by-page
instead of one transaction at a time.  To avoid a race condition with some
subtransactions appearing committed before others in the case where they span
more than one pg_clog page, we conserve the logic that marks them subcommitted
before marking the parent committed.

Simon Riggs with minor help from me
src/backend/access/transam/README
src/backend/access/transam/clog.c
src/backend/access/transam/transam.c
src/backend/access/transam/twophase.c
src/backend/access/transam/xact.c
src/include/access/clog.h
src/include/access/transam.h