Rework subtransaction commit protocol for hot standby.
Alvaro Herrera <alvherre@alvh.no-ip.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/transam/clog.c | modified | +214 −15 |
| src/backend/access/transam/README | modified | +15 −6 |
| src/backend/access/transam/transam.c | modified | +27 −117 |
| src/backend/access/transam/twophase.c | modified | +3 −6 |
| src/backend/access/transam/xact.c | modified | +13 −59 |
| src/include/access/clog.h | modified | +3 −2 |
| src/include/access/transam.h | modified | +4 −7 |