Skip site navigation (1) Skip section navigation (2)

Re: Subtransaction commits and Hot Standby

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, List pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Subtransaction commits and Hot Standby
Date: 2008-09-23 21:47:11
Message-ID: 1222206431.4445.493.camel@ebony.2ndQuadrant (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
On Thu, 2008-09-18 at 15:59 +0100, Simon Riggs wrote:
> On Tue, 2008-09-16 at 10:11 -0400, Alvaro Herrera wrote:
> 
> > I wonder if the improved clog API required to mark multiple
> > transactions as committed at once would be also useful to
> > TransactionIdCommitTree which is used in regular transaction commit.
> 
> I've hacked together this concept patch (WIP).
> 
> Not fully tested yet, but it gives a flavour of the API rearrangements
> required for atomic clog updates. It passes make check, but that's not
> saying enough for a serious review yet. I expect to pick this up again
> next week.

I've tested this some more and am much happier with it now.
Also added README details; there are no user interface or behaviour
changes.

The patch removes the need for RecordSubTransactionCommit() which

* reduces response times of subtransaction queries because we are able
to apply these changes in batches at commit time. This requires a
batch-style API that now works atomically, so there is much change in
transam.c

* reduces the path length for visibility tests for all users viewing
concurrent subtransaction activity since we are much less likely to
waste time following a long trail to an uncommitted higher-level
transaction

* removes the need for additional WAL logging to implement
subtransaction commits for Hot Standby

So half the patch is refactoring, half rearranging of clog access
functions to support batched-access.

An early review would greatly help my work on Hot Standby. Thanks.

-- 
 Simon Riggs           www.2ndQuadrant.com
 PostgreSQL Training, Services and Support

Attachment: atomic_subxids.v3a.patch
Description: text/x-patch (28.7 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Josh BerkusDate: 2008-09-23 22:07:30
Subject: Re: Proposal of SE-PostgreSQL patches (for CommitFest:Sep)
Previous:From: Hannu KrosingDate: 2008-09-23 21:29:34
Subject: Re: Toasted table not deleted when no out of linecolumns left

pgsql-patches by date

Next:From: Magnus HaganderDate: 2008-09-24 09:11:41
Subject: Re: Solve a problem of LC_TIME of windows.
Previous:From: Simon RiggsDate: 2008-09-23 15:42:21
Subject: Re: [PATCHES] Infrastructure changes for recovery

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group