Re: SV: Problem with pg_notify / listen

Noah Misch <noah@leadboat.com>

From: Noah Misch <noah@leadboat.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Gustavsson Mikael <mikael.gustavsson@smhi.se>, pgsql-bugs@lists.postgresql.org, Svensson Peter <peter.svensson@smhi.se>, Almen Anders <anders.almen@smhi.se>
Date: 2020-11-28T04:10:01Z
Lists: pgsql-bugs

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix a recently-introduced race condition in LISTEN/NOTIFY handling.

  2. Prevent concurrent SimpleLruTruncate() for any given SLRU.

On Fri, Nov 27, 2020 at 11:03:40PM -0500, Tom Lane wrote:
> Noah Misch <noah@leadboat.com> writes:
> > I think we don't yet have the right name here, seeing QUEUE_TAIL_PAGE !=
> > QUEUE_POS_PAGE(QUEUE_TAIL) sounds paradoxical, yet happens regularly.  How
> > about naming it QUEUE_STOP_PAGE?
> 
> Hmm, it's not very clear what "stop" means here.  What do you think of
> QUEUE_OLDEST_PAGE?

"STOP" would mean the same kind of thing it means in xidStopLimit,
multiStopLimit and offsetStopLimit.  Interpreted for pg_notify specifically,
it would mean "if queueing a notification would require use of this page,
throw an error."

QUEUE_OLDEST_PAGE is fine.  I like it a little less than QUEUE_STOP_PAGE,
because oldestClogXid is a logical tail, and QUEUE_OLDEST_PAGE would be a
physical tail.