Re: Prepared transactions vs novice DBAs, again - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Prepared transactions vs novice DBAs, again
Date
Msg-id 8785.1240426389@sss.pgh.pa.us
Whole thread Raw
In response to Re: Prepared transactions vs novice DBAs, again  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: Prepared transactions vs novice DBAs, again  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
Jeff Davis <pgsql@j-davis.com> writes:
> On Wed, 2009-04-22 at 11:00 -0700, Joshua D. Drake wrote:
>> Then perhaps a setting like max_stale_prepared_transaction_age and once
>> that threshold is met it will autorollback?

> I think that defeats the safety of prepared transactions in many cases.
> Let's say you PREPARE TRANSACTION on two systems, and then COMMIT
> PREPARED on the first one. Then, you go to COMMIT PREPARED on the second
> one, and the time has lapsed so you can't (and you can't rollback the
> first one, either).

Yeah, any sort of auto rollback on prepared xacts is scary.

You could probably argue that an autorollback threshold up around a
billion transactions is safe enough.  However, the bad side-effects
of a forgotten prepared transaction would start to happen long before
that, in the form of bloated tables.  (Or am I wrong about that?
Does a prepared xact still block vacuum cleanup in HEAD, or has that
been fixed since 8.2?)  I think DBAs would be tempted to set the
threshold a lot lower, and then sooner or later they'd lose data.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Prepared transactions vs novice DBAs, again
Next
From: Jeff Davis
Date:
Subject: Re: Prepared transactions vs novice DBAs, again