Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 9E733B5DD82 for ; Tue, 5 Jul 2011 15:18:11 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 44744-02-9 for ; Tue, 5 Jul 2011 18:17:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id B55A4B5DBD0 for ; Tue, 5 Jul 2011 15:16:23 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p65IGKMq021786; Tue, 5 Jul 2011 14:16:20 -0400 (EDT) To: Heikki Linnakangas cc: Kevin Grittner , pgsql-hackers@postgresql.org Subject: Re: SSI atomic commit In-reply-to: <4E13516F.50301@enterprisedb.com> References: <4E12FDA8020000250003EFC1@gw.wicourts.gov> <4E13516F.50301@enterprisedb.com> Comments: In-reply-to Heikki Linnakangas message dated "Tue, 05 Jul 2011 21:01:19 +0300" Date: Tue, 05 Jul 2011 14:16:20 -0400 Message-ID: <21785.1309889780@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201107/222 X-Sequence-Number: 191321 Heikki Linnakangas writes: > Hmm, I think it would be simpler to decide that instead of > SerializableXactHashLock, you must hold ProcArrayLock to access > LastSxactCommitSeqNo, and move the assignment of commitSeqNo to > ProcArrayTransaction(). It's probably easiest to move > LastSxactCommitSeqno to ShmemVariableCache too. There's a few places > that would then need to acquire ProcArrayLock to read > LastSxactCommitSeqno, but I feel it might still be much simpler that way. Yeah ... this patch creats the need to hold both SerializableXactHashLock and ProcArrayLock during transaction commit, which is a bit scary from a deadlock-risk perspective, and not pleasant from the concurrency standpoint either. It'd be better to push some functionality into the procarray code. regards, tom lane