Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1npIRo-0007Mk-6w for pgsql-hackers@arkaria.postgresql.org; Thu, 12 May 2022 23:42:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1npIRm-0006ng-RZ for pgsql-hackers@arkaria.postgresql.org; Thu, 12 May 2022 23:42:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1npIRl-0006Xv-1e for pgsql-hackers@lists.postgresql.org; Thu, 12 May 2022 23:42:18 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1npIRf-0004sT-W1 for pgsql-hackers@postgresql.org; Thu, 12 May 2022 23:42:15 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 7E6995C0190; Thu, 12 May 2022 19:42:08 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 12 May 2022 19:42:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1652398928; x=1652485328; bh=Tlxim2j3IH ienGl8w84D3fdFRuftPWi4Q2AZIU3ytF0=; b=bvJtWui+sLxNBctzKJjSsjhBmx rKs1agvfe8wty0hFW2sUsl+0Q7DJOb9NMRO01SAMjxOxvIXSl+xKZDI6Blcy3IMa Qh4F9yToS6vNGWVJE3LwxgWQexZsdzaBR3U60U0aIV1FnWoDNbt8f9nF7A4J7s7/ rT5xMfObiX2bcQQsRj87yffsXS5u9UWBZVcg3L+tM2hIVQpj+8U7xVYOOAulsQ/w 4kwedAoc3cT9viD58YZHSs4ebcKSig2TXShlfgMvaOL/49V1AQprpXaa3LTxk0Rb gq5ipSICdWKVraYytI6XTt5aY8MfQEtITghBeAOcLA8GbR9dDDLRW5FmTmnA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1652398928; x= 1652485328; bh=Tlxim2j3IHienGl8w84D3fdFRuftPWi4Q2AZIU3ytF0=; b=k 0aBYNbfd0C+ltIdDY5p5N0TGS4Z/+jcdakbD03MRuRMACdy9ZgjVkaknJO3ZndOy sLxEzphE6iEPZyL8cIA3nl7Pu2vyDNd2v0MJUBEHPE+EBOugC39RgskfEdiT6a1n uc/sa/Q7BhuI006HjQ3ZiX+2tnpOd7+9WHGjkYo0VbPY6zqm6v+FOizgh+59qbS1 LHzeDD5l+4v6UZ7oNjcq3DLa00w0Q74Sob9CupFXbBiE4uCwRdKeR4yaFUHsrRRK RCAcG1U3EEx290eOLkoHcV1+Q6SzE1RM+9rNA+IOiNAo0M5wgtRoziSWf7RzBipR BFl18Pes/AuDS3uCIWrPA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrgeekgddvgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrg htthgvrhhnpedvffefvefhteevffegieetfefhtddvffejvefhueetgeeludehteevudei tedtudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 12 May 2022 19:42:08 -0400 (EDT) Date: Thu, 12 May 2022 16:42:07 -0700 From: Andres Freund To: Simon Riggs Cc: Jeff Davis , PostgreSQL Hackers Subject: Re: Comments on Custom RMGRs Message-ID: <20220512234207.pwwp6q33f72byet2@alap3.anarazel.de> References: <20220512034010.4oqa76pasrulkw32@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2022-05-12 22:26:51 +0100, Simon Riggs wrote: > On Thu, 12 May 2022 at 04:40, Andres Freund wrote: > > I'm not happy with the idea of random code being executed in the middle of > > CheckPointGuts(), without any documentation of what is legal to do at that > > point. > > The "I'm not happy.." ship has already sailed with pluggable rmgrs. I don't agree. The ordering within a checkpoint is a lot more fragile than what you do in an individual redo routine. > Checkpoints exist for one purpose - as the starting place for recovery. > > Why would we allow pluggable recovery without *also* allowing > pluggable checkpoints? Because one can do a lot of stuff with just pluggable WAL records, without integrating into checkpoints? Note that I'm *not* against making checkpoint extensible - I just think it needs a good bit of design work around when the hook is called etc. I definitely think it's too late in the cycle to add checkpoint extensibility now. > > To actually be useful we'd likely need multiple calls to such an rmgr > > callback, with a parameter where in CheckPointGuts() we are. Right now the > > sequencing is explicit in CheckPointGuts(), but with the proposed callback, > > that'd not be the case anymore. > > It is useful without the extra complexity you mention. Shrug. The documentation work definitely is needed. Perhaps we can get away without multiple callbacks within a checkpoint, I think it'll become more apparent when writing information about the precise point in time the checkpoint callback is called. > I see multiple uses for the rm_checkpoint() point proposed and I've > been asked multiple times for a checkpoint hook. Any rmgr that > services crash recovery for a non-smgr based storage system would need > this because the current checkpoint code only handles flushing to disk > for smgr-based approaches. That is orthogonal to other code during > checkpoint, so it stands alone quite well. FWIW, for that there are much bigger problems than checkpoint extensibility. Most importantly there's currently no good way to integrate relation creation / drop with the commit / abort infrastructure... Greetings, Andres Freund