Re: BUG #14830: Missed NOTIFications, PostgreSQL 9.1.24

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Marko Tiikkaja <marko(at)joh(dot)to>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14830: Missed NOTIFications, PostgreSQL 9.1.24
Date: 2017-10-10 18:07:36
Message-ID: 7833.1507658856@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I wrote:
> Wait, I have an idea. Let's fetch a snapshot at the top of
> ProcessIncomingNotify, and then use the snapshot to decide whether
> xids are running, instead of calling TransactionIdIsInProgress.

Concretely, I suggest the attached patch. I tried Marko's testbed
against this, and it seems indeed a bit faster than before ---
running it for 100000 notifies takes about 19.25 seconds, rather than
19.5 seconds with HEAD. But the testbed is probably about the best
case because it has a bunch of threads sending notifies to one
receiver, so that the receiver is quite likely to have multiple
messages to read at a time. OTOH, in a situation where the NOTIFY
traffic isn't so high, it probably hardly matters anyway.

regards, tom lane

Attachment Content-Type Size
fix-notify-xact-testing.patch text/x-diff 6.5 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Petr Jelinek 2017-10-10 19:54:48 Re: 10.0: Logical replication doesn't execute BEFORE UPDATE OF <columns> trigger
Previous Message Tom Lane 2017-10-10 17:18:39 Re: ./configure error: Cannot find a working 64-bit integer type