Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WO5AU-00069k-I1 for pgsql-bugs@arkaria.postgresql.org; Thu, 13 Mar 2014 12:55:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WO5AT-0006C2-TN for pgsql-bugs@arkaria.postgresql.org; Thu, 13 Mar 2014 12:55:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WO5AR-0006Bt-TB for pgsql-bugs@postgresql.org; Thu, 13 Mar 2014 12:55:23 +0000 Received: from mail-la0-f46.google.com ([209.85.215.46]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WO5AH-0000bV-L8 for pgsql-bugs@postgresql.org; Thu, 13 Mar 2014 12:55:22 +0000 Received: by mail-la0-f46.google.com with SMTP id hr17so645763lab.33 for ; Thu, 13 Mar 2014 05:55:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=m1yVs8Ljdzxl+bPlITvzkUsKvtqgOuT7K6nfSg08Eyc=; b=bPpJkXMsyiDotYOYTxW8jITtiXXbAygTX/M9PlgBSQDIDzOZkXvk3sAzKJSRDvlkHC SOGg7wU86XCvNVm/7yjPCymlixD89b/HI499N2o8neNbyqVp1rCtMh/dyGWeJzSIo7qQ wrgwwaXECQ6MfhGHn7g7cVayHSVntvM1AwWBu1zOuuqB/QusSr+lf/SlVvMmX5ISW5al iMNi1MtOEAWgWW68z2aHo4ensLDs3gQSrhfj8MdyFPyQZ56dpNZ+lVGIkkMtiYQN/hvV shqDSd4AF/lhk5kFIO0ypeMFEymi6OjPpJfdE9NitGPHpCEGFMRyrU1OWuQ0C5y+xoue a3BA== X-Gm-Message-State: ALoCoQkdR5FNCa5X4vRnv2vZwi4cYyCdg2Mzn0LeM87SfLlLvX8JVCrze7v8gHTQF+CNXq8jr8gd X-Received: by 10.112.138.10 with SMTP id qm10mr1066000lbb.19.1394715312807; Thu, 13 Mar 2014 05:55:12 -0700 (PDT) Received: from Markos-MacBook-Pro.local ([46.246.117.202]) by mx.google.com with ESMTPSA id kz7sm1714355lab.16.2014.03.13.05.55.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Mar 2014 05:55:11 -0700 (PDT) Message-ID: <5321AAAF.4020207@joh.to> Date: Thu, 13 Mar 2014 13:55:11 +0100 From: Marko Tiikkaja User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: pgsql-bugs@postgresql.org Subject: Re: BUG #9557: Row not visible after receiving notification References: <20140313093922.335.80556@wrigleys.postgresql.org> In-Reply-To: <20140313093922.335.80556@wrigleys.postgresql.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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