Re: Listen / Notify rewrite - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Listen / Notify rewrite
Date
Msg-id 14441.1257996309@sss.pgh.pa.us
Whole thread Raw
In response to Listen / Notify rewrite  (Joachim Wieland <joe@mcknight.de>)
Responses Re: Listen / Notify rewrite
Re: Listen / Notify rewrite
List pgsql-hackers
Joachim Wieland <joe@mcknight.de> writes:
> However, if for some reason we cannot write to the slru files in the pg_notify/
> directory we might want to roll back the current transaction but with the
> proposed patch we cannot because we have already committed...

I think this is a deal-breaker, and arguing about how the pg_notify
directory ought to be writable is not even slightly acceptable --- out
of disk space is an obvious risk.  The existing implementation
guarantees that notifications obey ACID: if you commit, they are sent,
and if you don't, they aren't.  You can't just put in something that
works most of the time instead.

> One possible solution would be to write to the queue before committing
> and adding the TransactionID.  Then other backends can check if our
> TransactionID has successfully committed or not. Not sure if this is
> worth the overhead however...

That sounds reasonable, and it's certainly no more overhead than the
tuple visibility checks that happen in the current implementation.

> 2. The payload parameter is optional. A notifying client can either call
> "NOTIFY foo;" or "NOTIFY foo 'payload';". The length of the payload is
> currently limited to 128 characters... Not sure if we should allow longer
> payload strings...

Might be a good idea to make the max the same as the max length for
prepared transaction GUIDs?  Not sure anyone would be shipping those
around, but it's a pre-existing limit of about the same size.
        regards, tom lane


pgsql-hackers by date:

Previous
From: A.M.
Date:
Subject: Re: Listen / Notify rewrite
Next
From: Andrew Chernow
Date:
Subject: Re: Listen / Notify rewrite