Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id E5AAD6344BE for ; Mon, 5 Oct 2009 15:46:23 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 30187-09 for ; Mon, 5 Oct 2009 18:46:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail136008.authsmtp.com (outmail136008.authsmtp.com [62.13.136.8]) by mail.postgresql.org (Postfix) with ESMTP id B7C42634490 for ; Mon, 5 Oct 2009 15:46:12 -0300 (ADT) Received: from mail-c194.authsmtp.com (mail-c194.authsmtp.com [62.13.128.121]) by punt3.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id n95Ik41V091456; Mon, 5 Oct 2009 19:46:04 +0100 (BST) Received: from [192.168.0.5] (88-110-238-233.dynamic.dsl.as9105.com [88.110.238.233]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id n95Ik0UZ040500; Mon, 5 Oct 2009 19:46:01 +0100 (BST) Subject: Re: Hot Standby on git From: Simon Riggs To: Tom Lane Cc: Heikki Linnakangas , pgsql-hackers In-Reply-To: <6950.1254752345@sss.pgh.pa.us> References: <1253958559.4449.833.camel@ebony.2ndQuadrant> <4ABF4522.6060601@enterprisedb.com> <1254743455.4691.153.camel@ebony.2ndQuadrant> <6950.1254752345@sss.pgh.pa.us> Content-Type: text/plain Date: Mon, 05 Oct 2009 19:49:49 +0100 Message-Id: <1254768589.4691.249.camel@ebony.2ndQuadrant> Mime-Version: 1.0 X-Mailer: Evolution 2.12.0 Content-Transfer-Encoding: 7bit X-Server-Quench: 540002f6-b1df-11de-9488-0022640b883e X-Report-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZOTQEd DAteCiN5VAwpPBRK HVkIKg5MJUcNSQVJ NksadRtFaABbYlpF HGQLW11EUVR7XWV/ awsfZQ1DY0tOQQdp WFZLQVFNFgBqBAMB SEAXV2Apd2AseHpw YEZiEHVcX0c0cEJ9 Qk5WQ2sbN2Y0Pn0e URQNagpQeAtXfh9H aFZ7VCEFaWZSKBg1 TUcAHxkaHhhlExEd YgYRZWkOSEAHFC90 QBZKEjQzdQAA X-Authentic-SMTP: 61633235383639.1015:706/Kp X-Virus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.579 tagged_above=-10 required=5 tests=AWL=0.020, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200910/344 X-Sequence-Number: 147156 On Mon, 2009-10-05 at 10:19 -0400, Tom Lane wrote: > Simon Riggs writes: > > I don't see how that helps at all. The objective of lock counters was to > > know if we can skip acquiring an LWlock on all lock partitions. This > > change keeps the lock counters yet acquires the locks we were trying to > > avoid. This change needs some justification since it is not a bug fix. > > [ scratches head ... ] Why is hot standby messing with this sort of > thing at all? It sounds like a performance optimization that should > be considered separately, and *later*. Possibly. We have 3 suggested approaches: * Avoid taking LockPartition locks while we get info for Hot Standby during normal running, by means of a ref counting scheme (Simon) * Take the locks and implement a ref counting scheme (Heikki) * Take the locks, worry later (Tom) The middle ground seems pointless to me. I'm happy to go with simple lock-everything-for-now but it's pretty clear its going to be a annoying performance hit. If we do that we should put in a parameter to turn on/off so that those who will never use Hot Standby can avoid this completely. I'll wait for Heikki's thoughts before implementing anything. -- Simon Riggs www.2ndQuadrant.com