Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 83836B5D91F for ; Thu, 27 Oct 2011 11:13:35 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 74215-10 for ; Thu, 27 Oct 2011 14:13:29 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 2A0FDB5DC17 for ; Thu, 27 Oct 2011 11:13:28 -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 p9REDDwS027828; Thu, 27 Oct 2011 10:13:13 -0400 (EDT) To: Simon Riggs cc: Robert Haas , Florian Pflug , Aidan Van Dyk , Daniel Farina , Chris Redekop , PostgreSQL-development Subject: Re: Hot Backup with rsync fails at pg_clog if under load In-reply-to: References: <213AEFBF-479C-4F9E-B0CA-24AAB2C9F4DD@phlo.org> <1A94CE1A-C3E5-4923-B677-623D41BC273F@phlo.org> <6C3D7EDA-573E-46DC-9047-5FEB92876DA8@phlo.org> <12E895D5-C6D0-4E71-B9C3-85E1BC14E6B8@phlo.org> <18333.1{ h@ Comments: In-reply-to Simon Riggs message dated "Thu, 27 Oct 2011 14:36:54 +0100" Date: Thu, 27 Oct 2011 10:13:13 -0400 Message-ID: <27827.1319724793@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201110/1450 X-Sequence-Number: 197256 Simon Riggs writes: > On Thu, Oct 27, 2011 at 12:36 PM, Robert Haas wrote: >> On Thu, Oct 27, 2011 at 5:37 AM, Simon Riggs wrote: >>> It's much easier to understand that StartupCLOG() is actually a no-op >>> and that we need to trim the clog at the end of recovery in all cases. >> If it's a no-op, why have it at all? > It is a no-op for exactly the same reason other similar functions are > no-ops - it used to do something but now does not. > Anyone seeing StartupSubtrans and StartupMultiXact but no StartupClog > will immediately ask "why?". I think it's a good point that StartupCLog doesn't exist in a vacuum but should be parallel to the init functions for the other SLRU modules. So at this point I think I agree with Simon's approach. However, the obvious next question is whether those other modules don't need to be changed also, and if not why not. Another issue is that if StartupCLog is left as a no-op, what will happen if someone mistakenly tries to access clog before the trim function is called? It would be a good idea to make sure that such a thing results in an easily-identifiable failure. regards, tom lane