Re: BUG #9557: Row not visible after receiving notification

From: Marko Tiikkaja <marko(at)joh(dot)to>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #9557: Row not visible after receiving notification
Date: 2014-03-13 12:55:11
Message-ID: 5321AAAF.4020207@joh.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 3/13/14 10:39 AM, marko(at)joh(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Marko Tiikkaja 2014-03-13 13:26:47 Re: BUG #9557: Row not visible after receiving notification
Previous Message Fujii Masao 2014-03-13 10:52:28 Re: BUG #9118: WAL Sender does not disconnect replication clients during shutdown