Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aTtO3-0002Aw-Ld for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Feb 2016 15:42:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aTtO3-0008WV-8M for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Feb 2016 15:42:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aTtO2-0008WF-KU for pgsql-hackers@postgresql.org; Thu, 11 Feb 2016 15:42:30 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aTtNz-0000se-V3 for pgsql-hackers@postgresql.org; Thu, 11 Feb 2016 15:42:30 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u1BFgNHL014582; Thu, 11 Feb 2016 10:42:23 -0500 From: Tom Lane To: Robert Haas cc: "pgsql-hackers@postgresql.org" Subject: Re: Re: [COMMITTERS] pgsql: Add some isolation tests for deadlock detection and resolution. In-reply-to: References: <21023.1455200996@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Thu, 11 Feb 2016 09:48:39 -0500" Date: Thu, 11 Feb 2016 10:42:23 -0500 Message-ID: <14581.1455205343@sss.pgh.pa.us> X-Pg-Spam-Score: -2.1 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Robert Haas writes: >> That would be great. Taking a look at what happened, I have a feeling >> this may be a race condition of some kind in the isolation tester. It >> seems to have failed to recognize that a1 started waiting, and that >> caused the "deadlock detected" message to reported differently. I'm >> not immediately sure what to do about that. > Yeah, so: try_complete_step() waits 10ms, and if it still hasn't > gotten any data back from the server, then it uses a separate query to > see whether the step in question is waiting on a lock. So what > must've happened here is that it took more than 10ms for the process > to show up as waiting in pg_stat_activity. No, because the machines that are failing are showing a "" annotation that your reference output *doesn't* have. I think what is actually happening is that these machines are seeing the process as waiting and reporting it, whereas on your machine the backend detects the deadlock and completes the query (with an error) before isolationtester realizes that the process is waiting. It would probably help if you didn't do this: setup { BEGIN; SET deadlock_timeout = '10ms'; } which pretty much guarantees that there is a race condition: you've set it so that the deadlock detector will run at approximately the same time when isolationtester will be probing the state. I'm surprised that it seemed to act consistently for you. I would suggest putting all the other sessions to deadlock_timeout of 100s and the one you want to fail to timeout of ~ 5s. That will mean that the "" output should show up pretty reliably even on overloaded buildfarm critters. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers