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.96) (envelope-from ) id 1w9uV0-001shP-2r for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Apr 2026 00:40:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w9uTz-00D5hM-3C for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Apr 2026 00:39:56 +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.96) (envelope-from ) id 1w9uTz-00D5hC-2H for pgsql-hackers@lists.postgresql.org; Tue, 07 Apr 2026 00:39:56 +0000 Received: from mail-qv1-xf2f.google.com ([2607:f8b0:4864:20::f2f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w9uTx-00000000zvO-24U3 for pgsql-hackers@lists.postgresql.org; Tue, 07 Apr 2026 00:39:55 +0000 Received: by mail-qv1-xf2f.google.com with SMTP id 6a1803df08f44-8a58057d7baso69809876d6.1 for ; Mon, 06 Apr 2026 17:39:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775522392; cv=none; d=google.com; s=arc-20240605; b=H9ucYs22MDPp6L2a5zhDsNRng0o0HFHK9mr6rHSnLy2AqD3y35ZJyqgBnL5eisweiw iaPuu/gBeiWKYbXxt3INOhhL2oY6pdF6p/fc3QEniaQ/c6Riu8zq3e8UvzKZCLaN1Vzy 5Q+ZBGx1abhflMTUJ6Qut4/EvMKXnDRK3nUoHNM9MmawBY24xZwPC2wAz9MOwy8CVtkV KdMLAMZXwKM3JP6Q3IPyVWXVtR0JZAY6lRorPLMRHgs009CYByMUCMOc2AXJRgSJhxFd 7NsUT1qErkmT+u3d+dLH+H3Li2oPvSJXzWNZpWr1MAHHFvaGOkokqx9h/afxYqj/U1RB mrzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=1eJHaw1EJAzA3GopgdoUJV9okQooRCmi3gUFLokcxbE=; fh=XGIT1XG6Nu8Ir0ZdhBnCidQaQ2ycsBreHhdXJZ+Jkbw=; b=czXCrrIR3z9Wj4Bi4nafa3OQntlnvy2mCXM0MJJj2PJFLnffGvj+K8rfOE8YcIioRb dXy9Q8eNss9VwUbDAvwbADX83IlAhI4htEzA+ZotaNEKOh/lJ7vMFZkyl+r+9qRD8JsD 1VAeK3dxDgURts8wQNc+uBwdD/wPS7aBzXKyLG+a+hyVxpBAWewTHQqac2MmBf8/NiXl zbyoa+PphQqEhXPIoDmUO/lUuc7L4CVMCliUaHoWqYBaYtgoxNxQKVyuBLr6+uY+PYLK Snmrbwy2ybgXcCJ+9nHh+w5z+5x9bJn3+GQyRaAQmtzeGlBcmBvA0WXted6OdU7k2EZC DtTA==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fittl.com; s=google; t=1775522392; x=1776127192; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=1eJHaw1EJAzA3GopgdoUJV9okQooRCmi3gUFLokcxbE=; b=TRZJ91AfPxLSTgRBE5HMkRZPIwzFP/1qoE6yESYDDKppi0/6vhKmlkZ89TWOWgAFM3 HyUtPXiOOgr5l8QNnLeLj8BhDwZTNOO/B6yeObAuvoGtBSWqMbdzt/+j74g9vKqV8tWz DvZGDBKu/gcpgv80Qp4HAH9x+QZljeHn917WU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775522392; x=1776127192; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=1eJHaw1EJAzA3GopgdoUJV9okQooRCmi3gUFLokcxbE=; b=eTHVLPaKexAUCkcBVzGc7oCcQh+hwEINDIT89JJpXCpw5iCs+pTWJC29TBgjKOrEnW LPSYlE9wDcyFVjyWBMbrnX5vs4cgp+v0QDRHwV3/otU2IHgpPj+N1NhvgV7vjoA5//ly pTLTd+0YwMaqA2dSpV+5nRKC2OA01rR/5xw8DFzb5Qx/LMpBgTlTbBBPjDC5oftPpqlK JwKMnb3ysc7vO1hvsMQlJOyrgYhvkKcfYM8ss8IvXIaZ7dqnceFaT9wXCTfc3MOKpFbY Iv7GRHfyS+oWlyFbI1TH7xXLs5iCvqTtoMKrxYIYbkmo+vjXAHvOaXIGm/9oU8jaHJLg Stcg== X-Forwarded-Encrypted: i=1; AJvYcCVNuH8HgJ5/LVuUlDD1KQf+/EgdJq8IzP0E2JGxrCQ7nBPW9FONSs47rHPuY6wdPhhm2EkfQXgBDg/aQmfa@lists.postgresql.org X-Gm-Message-State: AOJu0YzeEJJXMNNozhweLgnUsBrH8eoGY2BRX9kYoKKtqzA+zKj4LIj0 UNeKL0khow1rFZ1uFSGn8cL55plAWzVYcuFjhW2cbcZUofJhX7kFKWglpkD1bOl/2OSIrUXKKxB 9A45NiPv5zh51+ULAGXwq+MQgYF/xXZ0gTw7boDBI X-Gm-Gg: AeBDietHmUEsfUD2lomas0RxENHkqlTie0vTlcclPW7ve6ZWVh8/lfEkwYSHr6LHHjo o4445vCTbHIinDFcbUiE+kYNXH7f+JxOOkEISU5d/VRayrjpTqkgMYEcRVqpxWsFT4FX49psMR7 CQqbBSu7Oy0Ys+khLw+3m1qqXEdo6Lwk7HdJ41uCAuyeeyfMEmE9IUFF1xjaICT9Hskn5lpsUEF VKx+cKfzIbjar4pUHrLKpUjUYuKwUQFT8PUFjpOc7rXbQCDcL1KDJoiI9JNI7FyyUasqsPdVtLU PiHa7n0+w70eDmQCFfLB0Ro4brOL/oGxtjKzSmY= X-Received: by 2002:a05:6214:29c4:b0:8a1:88f7:d283 with SMTP id 6a1803df08f44-8a704ea6911mr249221066d6.51.1775522391787; Mon, 06 Apr 2026 17:39:51 -0700 (PDT) MIME-Version: 1.0 References: <57biou6l65r7gr4nunoe6lignz2x6m3w45gihoypaez4pc46di@txj3bakhj66l> <3xbje45m5knff52mye5dfnrjdnwv7it2bzmqac3jqe66fvop4a@xvhy6zx7n6sb> In-Reply-To: From: Lukas Fittl Date: Mon, 6 Apr 2026 17:39:15 -0700 X-Gm-Features: AQROBzBZNg8j9R1cbS-MQrru1T4veeC67fgbZ7GHk5meHnHx1hXH1E4XQb5A-Vs Message-ID: Subject: Re: Stack-based tracking of per-node WAL/buffer usage To: Zsolt Parragi Cc: Andres Freund , Heikki Linnakangas , PostgreSQL Hackers , Tomas Vondra , Peter Smith Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Apr 6, 2026 at 3:46=E2=80=AFPM Zsolt Parragi wrote: > > I couldn't find any issues with v15, all comments are stylistic/minor, > except maybe the first one. Thanks for reviewing! > > + /* Abort handling: link in parent QueryInstrumentation's unfinalized li= st */ > + dlist_node unfinalized_entry; > > Is it okay to store a pointer in shared memory, even if it seems to be > always NULL there? Its not ideal, mainly because a caller might interpret it incorrectly, but as long as we don't read from it, its safe in practice. In the parallel instrumentation we just use the Instrumentation struct as a way to transport data (with the 0006 patch applied), and we copy/accumulate from it before it gets used elsewhere. I've previously avoided putting the unfinalized_entry value in the Instrumentation struct for that reason, but I don't think there is a good way to avoid that without complicating the design. > > #ifndef INSTRUMENT_NODE_H > #define INSTRUMENT_NODE_H > > + > +#include "executor/tuptable.h" > +#include "nodes/execnodes.h" > + > > Is it okay to incude files in the middle of the file, is there a good > reason why these can't be at the top of the file? Yeah, those need to be on the top of the file, good catch. > > + * Recurse into children first (bottom-up accumulation), and accummulate > + * to this nodes instrumentation as the parent context. > > Two typos (accumulate / this node's) Good catch, agreed those are typos. > > #define RELEASE_PRIO_FILES 600 > #define RELEASE_PRIO_WAITEVENTSETS 700 > +#define RELEASE_PRIO_INSTRUMENTATION 800 > > This is mainly a generic observation, not strictly related to this > patch, but this list could use some explanation which of these > priorities are actually required by dependencies, and which are just > "put the new entry at the end of the list". Agreed, that would be helpful. It'll require more investigation to confirm particular ordering reasons that exist today, but it seems worth explaining more clearly. I'll hold off on posting another patch round since what you raised were just small stylistic issues, and they don't apply to the remaining prep patches before the stack patch itself. Thanks, Lukas --=20 Lukas Fittl