Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rS3sD-00B8Re-So for pgsql-bugs@arkaria.postgresql.org; Mon, 22 Jan 2024 23:38:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rS3sC-007fmO-UU for pgsql-bugs@arkaria.postgresql.org; Mon, 22 Jan 2024 23:38:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rS3sB-007fmF-EH for pgsql-bugs@lists.postgresql.org; Mon, 22 Jan 2024 23:38:36 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rS3s7-003CTW-Qm for pgsql-bugs@lists.postgresql.org; Mon, 22 Jan 2024 23:38:34 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.west.internal (Postfix) with ESMTP id 9B5AC3200A95; Mon, 22 Jan 2024 18:38:27 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Mon, 22 Jan 2024 18:38:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1705966707; x=1706053107; bh=encTI7LfhX iC3ZvKHXyN1Pv9v697CpgeDPZwAa3rvmE=; b=nM/x9VmuC5Jc3aeT4MMXizyYRd T3ewzKCxavdjhPf3YlQCMlayCkpSehPWDBbGYcQQqZLgZlkKXlbOCC+1OgbLi4cr VY1WE04XjAGNEycpNvPy+4aN5UMBcVLaEw4DiiXLMAcr8AwnwyEN7L5HLSRrP1lJ 2mMRGkymeHJo9a2CKj+sxTBlxKOEs+zl8SVGZVfQqV5DEVwZkkUFDMRNqGZTn9XL yzQ9e0tYIPy/mDFLo6Q4guANCtpr2O9JRPwsh/ui0z6G3ZjCmf41SU3YmbJks51j H0TsHLph4X84gKTUB+SPHjh5e9PDrFvMnNGiOXS7EVbtT7SuoxjmbANynsHQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1705966707; x=1706053107; bh=encTI7LfhXiC3ZvKHXyN1Pv9v697 CpgeDPZwAa3rvmE=; b=m8Pa0KO29PfZIhIUuJdo7lHy+e1FtLffEbDlSZuO8j+g qgc+/A0Tu1cueeZqb6UG2EHKid1YoVJoZlxFSLbSZimgCIxPFLBH+HadVSqg+Lgy vdM3hJZJuihkQrlx7bjOAXFucdNP4gX/U1HfSOfaAjilKWLO9vCtbGDb28Zga00/ sgAEnq5BmaUaNq8mB8fOgWPHeOYuUPCzF2C3ZDndTcSVxTz5/QlVKy+e+LJjLXLu DtpZOWNCUEFFfTehvhuQ9cF0QobdGgTlmg66W5VweBCW/BH5hBYWZqPDPYmRIBye oiaGtfpSlDHMFFItArJye8xNbkRFllzkci1YCU5JsA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdekjedgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeg geegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 22 Jan 2024 18:38:24 -0500 (EST) Date: Tue, 23 Jan 2024 08:38:09 +0900 From: Michael Paquier To: Heikki Linnakangas Cc: feichanghong , pgsql-bugs Subject: Re: MarkBufferDirty Assert held LW_EXCLUSIVE lock fail when ginFinishSplit Message-ID: References: <053bc845-3cb5-445e-8ea4-00f6c678ee25@iki.fi> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="BXvuvoWrvJreGHeL" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --BXvuvoWrvJreGHeL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jan 22, 2024 at 10:47:17PM +0200, Heikki Linnakangas wrote: > Michael, it was a pleasure to write this test with the injection points, > compared to trying to set up PITR at just the right moment. Thank you! Since > this is the first test that uses it, I didn't have any precedence to > copy-paste; can you take a look and verify if this is how you imagined the > facility to be used? I was wondering how many weeks it would take for somebody to begin playing with that, and here you are 12 hours later.. +EXTRA_INSTALL = src/test/modules/injection_points [...] +#ifdef USE_INJECTION_POINTS + if (GinPageIsLeaf(BufferGetPage(stack->buffer))) + INJECTION_POINT("gin-leave-leaf-split-incomplete"); + else + INJECTION_POINT("gin-leave-internal-split-incomplete"); +#endif Yes, that would be one way of doing it. It makes the code a bit more invasive but that would work. Now, you expect this point to be conditional depending on the state of the buffer. One thing I was thinking of was to extend the APIs in injection_point.c to be able to handle a set of arguments as a set of (void*) so as callbacks could internally decide what they want to do depending on the running state. I didn't have a use for it, but well, you do, so perhaps we could just bite the bullet and do it. That reduces the footprint on the backend code, moving more logic behind USE_INJECTION_POINTS in injection_point.c. At the end, you should be able to patch the core backend with something like that, without using some ifdefs on USE_INJECTION_POINTS: INJECTION_POINT_1ARG("gin-leave-leaf-split", (void *) buffer) And INJECTION_POINT_1ARG() would be just a wrapper around something like: extern void InjectionPointRun1(const char *name, void *arg1); And then plug in the callback you want. Having the callback in a new test module with the SQL test itself would be OK, or you could just add it to src/test/modules/injection_points/ with a SQL test in it, or just use EXTRA_INSTALL. -- Michael --BXvuvoWrvJreGHeL Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmWu/GEACgkQnvQgOdby QH20qA//YIRJguLMS3BUFuzRWHWUj1RwBrPTs5hMxu6tVn6N7zVGKnWBr9/fLT6+ M9eN+5D33Sgy3IDoJBaQ1AMFy8J1CyGvNhAvmtOyUGYq6pwX09zGBvBYeVL73ZG2 HvUYux10DxXFeg7ZNkbIYp/uUziP389TMxU+PbU8UnB+wZpolsEi3D5kJzQGcFUs Ld30HUiXr3BHnOiaOeqWFvvaoWI+ea9NKd9T5p1KzW5+BMr5bom4jNaNTPR4qCm7 qWWibRJ6pAbdXAu41xGASkmgRhDL5AuzqdK4HcW3jceQXf7PysknZBg3KmPVfXkm mVfOiZfs2wuWjmrlkTKFwYMk/rRFRXENe+CmzToqPcFsyzv9HrMz2oMChPumpCz6 RKvznF+x+I96OmRfqZJke3cHEEajt9EvxiykdJgq/D0ub8gj6C5p82u66b/6OMpL 4IkS8RIacIL+efldfa6zFfwQd1xuc41PJGqbbz1B6F6AAE7S6a9BbKRfS1aT32zB gV7QGkoxWe5KhvDYaoQGhosO4f9kueNv4F75mac4tc4WLD7hudmPjyaALnpdjjIG UQREsY9fnp/IsBuDnFfhUpytyMuC1VwgpJ4DFwOi8/K/7ZWu5jBdv6ebzZ5ZIin/ FCMBV2n7dwrXDPrTFpVUZ1AF+xCz/WP/zpBzAMlMoeRvQLxhV9o= =05jb -----END PGP SIGNATURE----- --BXvuvoWrvJreGHeL--