Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 82483 invoked from network); 2 Nov 2010 12:58:19 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Nov 2010 12:58:19 -0000 Received: (qmail 97173 invoked by uid 500); 2 Nov 2010 12:58:50 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 96978 invoked by uid 500); 2 Nov 2010 12:58:48 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 96967 invoked by uid 99); 2 Nov 2010 12:58:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Nov 2010 12:58:47 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Nov 2010 12:58:46 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oA2CwQ2F019332 for ; Tue, 2 Nov 2010 12:58:26 GMT Message-ID: <4260762.193701288702706416.JavaMail.jira@thor> Date: Tue, 2 Nov 2010 08:58:26 -0400 (EDT) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-4881) Deadlock accessing SYS.SYSSTATISTICS In-Reply-To: <21267474.191941288698264585.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-4881?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12927386#action_12927386 ] Knut Anders Hatlen commented on DERBY-4881: ------------------------------------------- The patch looks good to me. And it removes more code than it adds! :) It looks like Dag handled most of the edges for the read uncommitted case in DERBY-3678, and with your change to ignore td==null, I think it should be safe in the list!=null case too. I was able to reproduce the deadlock in XplainStatisticsTest on nearly every run with an insane build in my environment. The patch seems to have fixed that, and now I'm not able to reproduce it. +1 to commit. > Deadlock accessing SYS.SYSSTATISTICS > ------------------------------------ > > Key: DERBY-4881 > URL: https://issues.apache.org/jira/browse/DERBY-4881 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.3.3.0, 10.4.2.0, 10.5.3.0, 10.6.2.1, 10.7.1.0 > Reporter: Kristian Waagan > Assignee: Kristian Waagan > Priority: Minor > Attachments: derby-4881-1a-deadlock_fix.diff > > > Transactions accessing index statistics can deadlock if one of them inserts new entries and the other selects from the system table. Inserts happens for instance when update of index statistics are perform manually, or when a table is compressed (given that the table has indexes and contains some rows). This issue may be more problematic when automatic update of index statistics is implemented. > Issue discovered when writing a regression tests for DERBY-4849, see discussion there. The bug is timing dependent, but has been observed on a variety of JVMs and platform architectures. > To sum up: > o using NO_WAIT + retry was suggested, but turned out to be an infeasible solution > o current approach is to allow using read uncommitted isolation level when accessing statistics in the system table (take no locks) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.