On Mon, Feb 15, 2010 at 1:48 PM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> On Mon, 2010-02-15 at 12:59 +0100, Joachim Wieland wrote:
>> I have tested it already. The point where it currently fails is the
>> following line:
>> qe->xid = GetCurrentTransactionId();
> That's a shame. So it will never work in Hot Standby mode unless you can
> think of a different way.
We could probably fake this on the Hot Standby in the following way:
We introduce a commit record for every notifying transaction and write
it into the queue itself. So right before writing anything else, we
write an entry which informs readers that the following records are
not yet committed. Then we write the actual notifications and commit.
In post-commit we return back to the commit record and flip its
status. Reading backends would stop at the commit record and we'd
signal them so that they can continue. This actually plays nicely with
Tom's intent to not have interleaved notifications in the queue (makes
things a bit easier but would probably work either way)...
However we'd need to make sure that we clean up that commit record
even if something weird happens (similar to TransactionIdDidAbort()
returning true) in order to allow the readers to proceed.
In response to
pgsql-hackers by date
|Next:||From: Jeroen Vermeulen||Date: 2010-02-15 19:51:26|
|Subject: Re: Avoiding bad prepared-statement plans.|
|Previous:||From: Greg Smith||Date: 2010-02-15 19:12:35|
|Subject: Re: psycopg2 license changed|