Re: ERRCODE_READ_ONLY_SQL_TRANSACTION

From: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Simon Riggs <simon(at)2ndQuadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ERRCODE_READ_ONLY_SQL_TRANSACTION
Date: 2012-01-13 08:55:39
Message-ID: 87vcog2d84.fsf@hi-media-techno.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> Simon Riggs <simon(at)2ndQuadrant(dot)com> writes:
>> Hot Standby returns ERRCODE_READ_ONLY_SQL_TRANSACTION in most cases
>> for illegal actions on a standby.
>
> I don't think I like this patch: you are promoting what are and ought to
> be very low-level internal sanity checks into user-facing errors (which
> among other things will require translation effort for the messages).

So it seems the last-9-2-CF deadline is making us a little too hasty.

Apparently as you're saying there's no way to exercise that code paths
from an SQL connection on a Hot Standby short of deploying a C coded
extension calling either GetNewTransactionId() or XLogInsert(), which
means it's out of scope.

My quest was figuring out if ERRCODE_READ_ONLY_SQL_TRANSACTION really is
trustworthy as a signal that you could transparently now redirect the
transaction to the master when seeing that in a “proxy” of some sort.

I felt that we were missing something simple here, but after review I
think we finally have all the pieces to achieve that with current 9.2
code base in fact.

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2012-01-13 09:17:37 Re: ERRCODE_READ_ONLY_SQL_TRANSACTION
Previous Message Fujii Masao 2012-01-13 08:02:55 Re: Online base backup from the hot-standby