pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marko Tiikkaja <marko@joh.to>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #9557: Row not visible after receiving notification
Date: Thu, 13 Mar 2014 13:55:11 +0100
Message-ID: <5321AAAF.4020207@joh.to> (raw)
In-Reply-To: <20140313093922.335.80556@wrigleys.postgresql.org>
References: <20140313093922.335.80556@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 3/13/14 10:39 AM, marko@joh.to wrote:
> We went live with an application a few days ago, and it's been having
> problems with seeing rows after receiving a notification from the
> transaction that committed it.  I can't say for sure how often it happens,
> but I've seen evidence suggesting at least three separate occasions.

I can reproduce this locally with some trickery.  Here's what I did:

   1) Stop the listener at HandleNotifyInterrupt() (suppose an unrelated 
notification comes in in the real world).
   2) In another backend, do what the application would normally do, but 
stop it before ProcArrayEndTransaction().
   3) Let the notification go through to the listener.  It sees *both* 
notifications (since the new one has been committed to CLOG).
   4) SELECT from the frontend after seeing the notification (#2 is 
still stuck right before ProcArrayEndTransaction).

This would explain it, as I don't see the notification code checking 
whether the transaction is still in PGPROC, just calling 
TransactionIdDidCommit().

Any thoughts?


Regards,
Marko Tiikkaja


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (9+ messages)  latest in thread

Message-ID: <5321AAAF.4020207@joh.to>
Permalink:  ../5321AAAF.4020207@joh.to/
Also on:    postgresql.org/message-id/5321AAAF.4020207@joh.to

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: marko@joh.to
  Subject: Re: BUG #9557: Row not visible after receiving notification
  In-Reply-To: <5321AAAF.4020207@joh.to>
  References: <20140313093922.335.80556@wrigleys.postgresql.org> <5321AAAF.4020207@joh.to>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox