Re: Listen / Notify rewrite

From: Joachim Wieland <joe(at)mcknight(dot)de>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org, Andrew Chernow <andrew(at)esilo(dot)com>
Subject: Re: Listen / Notify rewrite
Date: 2009-11-12 16:00:07
Message-ID: dc7b844e0911120800v71612714v7a78061082b72b55@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 12, 2009 at 3:30 PM, Merlin Moncure <mmoncure(at)gmail(dot)com> wrote:
> Couple of questions:
>
> *) is BLCKSZ a hard requirement, that is, coming from the slru
> implementation, or can QUEUE_PAGESIZE be bumped independently of block
> size.

It's the size of slru's pages.

> *) why not make the AsyncQueueEntry divide evenly into BLCKSZ, that
> is, make the whole structure a size that is a multiple of two?  (this
> would make the payload length 'weird')

it's possible and yes, it would make the payload length weird. Also if
we wanted to add further structure members later on (commit time, xid,
notify counter, whatever) we'd have to announce that payload in a new
release cannot have the same length as in a previous one, so I tried
to keep both independent right from the beginning.

> *) is there any downside you see to making the AsyncQueueEntry
> structure exactly BLCKSZ bytes in size?  Are we worried about the
> downsides of spinning the notifications out to disk?

Yes, and also we'd need a lot more page slots to work efficiently and
I fear quite some queue managing overhead (locking). Currently we are
using 4 page slots and can have ~160 notifications mapped into memory.

> *) Is a variable length AsyncQueueEntry possible? (presumably bounded
> by the max page size).  Or does complicate the implementation too
> much?

That's an option to look at, I think it's technically possible, we'd
just need to throw in some more logic but I didnt want to invest too
much effort before we have a clear way to go.

However I share Greg's concerns that people are trying to use NOTIFY
as a message queue which it is not designed to be.

Joachim

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bernd Helmle 2009-11-12 16:06:23 Re: Listen / Notify rewrite
Previous Message David Fetter 2009-11-12 15:55:13 array_to_string bug?