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 1nozgX-00015A-7e for pgsql-hackers@arkaria.postgresql.org; Thu, 12 May 2022 03:40:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nozgV-0007M0-KZ for pgsql-hackers@arkaria.postgresql.org; Thu, 12 May 2022 03:40:15 +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 1nozgV-0007Kx-Ca for pgsql-hackers@lists.postgresql.org; Thu, 12 May 2022 03:40:15 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nozgT-0002lS-59 for pgsql-hackers@postgresql.org; Thu, 12 May 2022 03:40:14 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 026825C018B; Wed, 11 May 2022 23:40:12 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 11 May 2022 23:40:12 -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=1652326811; x=1652413211; bh=VVKyy94ZeK da6v5axnxgmAmEd4N3KhawStAx4/A1Ovk=; b=ROflt5gJ/mlQOGh+1BAqQelu+Y RaZIS00iC05jl/imsEeJ8R3dohG5YRXgBzQJj8RKXucsGrbSQcAv61ygLZcI3IcB fW9SBqmUCcRhrbkW5lmB+qbhfFdVVEytP8Ng+SxUp7s/vwuPYLJ7MsnL6A/DRPYw jdGsh38plMHcRJxVMOR8NmtoiabByDmwL7q3y5MeMG9Qq0RLbCGSE0WtJtft+FaN 45j5g6nDhmbJ8I1afrO2WmCf/MgRVXMUfZ+BlFTyALAH6Br/jXXgHm7/oRLT4rVa f7a5IJZXRjrJjRMNJf1GY/Wxfym/TUw9h1v1BISG0LXD9i2qTMaQFLEMc+YQ== 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=1652326811; x= 1652413211; bh=VVKyy94ZeKda6v5axnxgmAmEd4N3KhawStAx4/A1Ovk=; b=U 6VXrL3FACuF/fVG6P/UP1LuqvOYMvTmklYlQ6HMgFd4NfWjANPGWaeIN5+RwfAwH IsmyNkS3PuJhcci+LYV5tQK+aa0VqMdd04tI0O12Lm5t3uqDraaSYoq1AbY0Dwma 8N+sfpByurvoupZ+tgqJFe7z0E86bIR+s3uKNNZIgJWaTygJyGC5T2phmVGL0S2t cPNAMfGi5vdBswVcGGPMWuxVcs9/l8FJQkgNKWlm5jOd0Epy3TIDJTF45gmoP44Z Uqpj2o5db1WiqvMTQHcU7DOicAXszCnRDQ/DEVP9Vwf6GTsa4UdBFqSjG0NxycYC wE8INashju5497fqPePNQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrgeeigdejvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrg htthgvrhhnpedvffefvefhteevffegieetfefhtddvffejvefhueetgeeludehteevudei tedtudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 11 May 2022 23:40:11 -0400 (EDT) Date: Wed, 11 May 2022 20:40:10 -0700 From: Andres Freund To: Jeff Davis Cc: Simon Riggs , PostgreSQL Hackers Subject: Re: Comments on Custom RMGRs Message-ID: <20220512034010.4oqa76pasrulkw32@alap3.anarazel.de> References: 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-11 09:39:48 -0700, Jeff Davis wrote: > On Wed, 2022-05-11 at 15:24 +0100, Simon Riggs wrote: > > [PATCH: rmgr_001.v1.patch] > > > > [PATCH: rmgr_002.v1.patch] > > Thank you. Both of these look like good ideas, and I will commit them > in a few days assuming that nobody else sees a problem. What exactly is the use case here? Without passing in information about whether recovery will be performed etc, it's not at all clear how callbacks could something useful? I don't think we should allocate a bunch of memory contexts to just free them immediately after? > > It occurs to me that any use of WAL presumes that Checkpoints exist > > and do something useful. However, the custom rmgr interface doesn't > > allow you to specify any actions on checkpoint, so ends up being > > limited in scope. So I think we also need an rm_checkpoint() call - > > which would be a no-op for existing rmgrs. > > [PATCH: rmgr_003.v1.patch] > > I also like this idea, but can you describe the intended use case? I > looked through CheckPointGuts() and I'm not sure what else a custom AM > might want to do. Maybe sync special files in a way that's not handled > with RegisterSyncRequest()? 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. 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. Greetings, Andres Freund