Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id A35042E007A for ; Wed, 4 Jun 2008 12:07:00 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 40688-05 for ; Wed, 4 Jun 2008 12:06:57 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from ppsw-9.csi.cam.ac.uk (ppsw-9.csi.cam.ac.uk [131.111.8.139]) by developer.postgresql.org (Postfix) with ESMTP id B68562E006F for ; Wed, 4 Jun 2008 12:06:57 -0300 (ADT) X-Cam-SpamDetails: Not scanned X-Cam-AntiVirus: No virus found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from flymine.sysbiol.cam.ac.uk ([131.111.60.120]:40894 helo=flymine.flymine.org) by ppsw-9.csi.cam.ac.uk (ppsw.cam.ac.uk [131.111.8.139]:25) with esmtp id 1K3uZc-0001WB-TO (Exim 4.67) for pgsql-performance@postgresql.org (return-path ); Wed, 04 Jun 2008 16:06:48 +0100 Received: from host103 ([192.168.128.103] helo=aragorn.flymine.org ident=Debian-exim) by flymine.flymine.org with esmtp (Exim 4.12) id 1K3uZc-0005xe-00 for pgsql-performance@postgresql.org; Wed, 04 Jun 2008 16:06:48 +0100 Received: from mnw21 (helo=localhost) by aragorn.flymine.org with local-esmtp (Exim 4.69) (envelope-from ) id 1K3uZc-0004rc-1Y for pgsql-performance@postgresql.org; Wed, 04 Jun 2008 16:06:48 +0100 Date: Wed, 4 Jun 2008 16:06:48 +0100 (BST) From: Matthew Wakeling X-X-Sender: mnw21@aragorn.flymine.org To: pgsql-performance@postgresql.org Subject: Re: backend pid changing In-Reply-To: <4846AA49.5010601@setonhome.org> Message-ID: References: <4846AA49.5010601@setonhome.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200806/21 X-Sequence-Number: 30371 On Wed, 4 Jun 2008, Lewis Kapell wrote: > The client sends its authorization information immediately before > sending the data, and also with the data chunk. Well, I have no idea why the backend pid is changing, but here it looks like you have a classic concurrency problem caused by checking a variable twice. It seems you have client-side error recovery on the initial check, but not on the second check. The solution is to eliminate the first check, and implement proper error recovery on the second check, so that the client can just get a new hash and try again. Matthew -- It's one of those irregular verbs - "I have an independent mind," "You are an eccentric," "He is round the twist." -- Bernard Woolly, Yes Prime Minister