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>
Subject: Re: Subtransaction commits and Hot Standby
Date: 2008-10-07 12:50:38
Message-ID: 1223383838.4747.154.camel@ebony.2ndQuadrant (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-patches
On Sun, 2008-10-05 at 14:51 -0400, Alvaro Herrera wrote:
> Simon Riggs wrote:
> > OK, spent long time testing various batching scenarios for this using a
> > custom test harness to simulate various spreads of xids in transaction
> > trees. All looks fine now.
> I had a look and was mostly rephrasing some comments and the README
> (hopefully I didn't make any of them worse than they were), when I
> noticed that the code to iterate thru pages could be refactored.  I
> think the change makes the algorithm in TransactionIdSetTreeStatus
> easier to follow.

Yes, all fits on one screen when reading it now.

> I also noticed that TransactionIdSetPageStatus has a "subcommit" arg
> which is unexplained.  I sort-of understand the point, but I think it's
> better that you fill in the explanation in the header comment (marked
> with XXX)

I've changed the logic slightly to remove the need for the subcommit
argument. So no need to explain now.

Added an Assert to check for what should be an impossible call.

Example provided in comments for a complex update.

> I hope I didn't break the code with the new function
> set_tree_status_by_pages -- please recheck that part.

Renamed to set_status_by_pages because we never use this on the whole
tree. Added comments to say that.

Overall, cleaner and more readable now. Thanks.

 Simon Riggs 
 PostgreSQL Training, Services and Support

Attachment: atomic_subxids.v7.patch
Description: text/x-patch (30.3 KB)

In response to


pgsql-hackers by date

Next:From: Simon RiggsDate: 2008-10-07 12:56:23
Subject: Re: Reducing some DDL Locks to ShareLock
Previous:From: Guillaume LelargeDate: 2008-10-07 12:34:08
Subject: Re: Weird behaviour with ALTER TABLE ... SET TABLESPACE ... statement

pgsql-patches by date

Next:From: Tom LaneDate: 2008-10-07 14:08:47
Subject: Re: [PATCHES] Infrastructure changes for recovery
Previous:From: Simon RiggsDate: 2008-10-07 08:17:25
Subject: Re: [PATCHES] Infrastructure changes for recovery

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