Re: Hot Standby 0.2.1

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Hot Standby 0.2.1
Date: 2009-09-25 10:23:51
Message-ID: 4ABC9A37.2090008@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Simon Riggs wrote:
> On Wed, 2009-09-23 at 17:45 +0300, Heikki Linnakangas wrote:
>> XactClearRecoveryTransactions() when we see a shutdown checkpoint, which
>> clears all recovery locks. But doesn't that prematurely clear all locks
>> belonging to prepared transactions as well?
>
> Much better to read your second post(s). :-)
>
> Yes, you have found a(nother) issue. This was the first one that gave me
> pause to think of the answer. The locks currently aren't tracked as to
> whether they are 2PC or not, so we would need to store that info also so
> that we can selectively release locks later.
>
> Question: is it possible to do a fast shutdown when we have a prepared
> transaction?

Yes.

> Would it be better to take a different approach there for
> prepared transactions? It seems strange to write a shutdown checkpoint
> when the system isn't yet "clean".

Hmm, I guess you could define prepared transactions as active backends
from the shutdown point of view, and wait for them to finish. I can see
one problem, though: Once you issue shutdown, fast or smart, we no
longer accept new connections. So you can't connect to issue the
ROLLBACK/COMMIT PREPARED anymore. Anyway, it would be a change from the
current behavior, so it would be better to cope with prepared
transactions in the standby.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2009-09-25 10:26:26 Re: Hot Standby 0.2.1
Previous Message Heikki Linnakangas 2009-09-25 10:14:53 Re: Hot Standby 0.2.1