Re: default_transaction_isolation = serializable causes crash under Hot Standby

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: robertmhaas(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org, tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: Re: default_transaction_isolation = serializable causes crash under Hot Standby
Date: 2012-04-29 16:38:32
Message-ID: CA+U5nMJyn=9X=8e1AD-+-C56ADkou+8h=14Uw2tSB82YeQ_Z8A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Apr 29, 2012 at 1:40 PM, Kevin Grittner
<Kevin(dot)Grittner(at)wicourts(dot)gov> wrote:

>> IMHO the desired behaviour would be
>>
>> * prevent default_transaction_isolation = serializable as a default
>> setting when we enter Hot Standby by throwing a FATAL error from
>> the startup process. I can help implement that if we agree.
>
> I'm not sure how well that plays for all users of HS.  It would work
> for us because there are a number of settings we want to change on a
> HS; we use a different postgresql.conf from the master, so this works
> fine.  I am concerned about people who want to promote the HS to a
> new master without swapping in a different conf file and doing a
> reload or restart -- if they want serializable transactions as the
> default on their master, how would this work?

I can see you might want to have a standby with hot_standby=off that
was immediately ready to take the place of the master. In that case,
the setting of default_transaction_isolation would have no effect on
the standby, so you are ready and waiting.

If you request hot_standby=on presumably you're not going to want a
continuous stream of ERRORs. Blocking that completely is hard because
we would need to test the parameter file as well as testing user or
database settings.

The only way default_transaction_isolation = serializable would be
acceptable when hot_standby = on is if we silently downgrade the
isolation level to read committed. That way everything just works,
albeit not quite as requested. So I think that's the best way
forwards.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-04-29 16:41:56 Re: smart shutdown at end of transaction (was: Default mode for shutdown)
Previous Message Magnus Hagander 2012-04-29 16:19:32 Re: 9.2 release notes, beta time?