On 2015-03-02 18:45:18 +0100, Andres Freund wrote:
> On 2015-03-02 19:23:56 +0200, Heikki Linnakangas wrote:
> > Pass the prepared XID as yet another argument to XactEmitCommitRecord, and
> > have XactEmitCommitRecord emit the xl_xact_commit_prepared part of the
> > record too. It might even make sense to handle the prepared XID like all the
> > other optional fields and add an xinfo flag for it.
>
> That's what I mean with "non simple". Not a fan of teaching xact.c even
> more about twophase's dealings than it already knows.
I made an effort to show how horrible it would look like. Turns out it's
not that bad ;). Far from pretty, especially in xlog.c, but
acceptable. I think treating them more similar actually might open the
road for reducing the difference further at some point.
The attached patch does pretty much what you suggested above and tries
to address all the point previously made. I plan to push this fairly
soon; unless somebody has further input.
Greetings,
Andres Freund
--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services