Hot Standby: subxid cache changes

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Hot Standby: subxid cache changes
Date: 2009-02-12 07:50:04
Message-ID: 4993D4AC.4060901@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

One independent change included in the Hot Standby patch is the change
to the way subtransaction cache works. With the patch, only
subtransactions that don't fit in the subxid cache in PGPROC are marked
in pg_subtrans. To make that work, XidInMVCCSnapshot() always scans the
subxid array in the snapshot, while currently it's only used if none of
the subxid caches have overflowed. Attached is a patch for that,
extracted from the latest hot standby patch.

So far so good, but what about all the other callers of
SubTransGetParent()? For example, XactLockTableWait will fail an
assertion if asked to wait on a subtransaction which is then released.

It occurs to me that we don't need this patch for hot standby if we
abuse the main xid array (SnapshotData.xip) to store the unobserved xids
instead of the subxid array. That one is always scanned in
XidInMVCCSnapshot. I think we should do that rather than try to salvage
this patch.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

Attachment Content-Type Size
hs-subxid-cache-changes-1.patch text/x-diff 10.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bernd Helmle 2009-02-12 10:04:37 Re: temporarily stop autovacuum
Previous Message Tao Ma 2009-02-12 07:35:52 some questions about SELECT FOR UPDATE/SHARE