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 1rArIV-008U16-95 for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Dec 2023 12:46: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 1rArIT-009G07-Js for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Dec 2023 12:46:37 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rArIS-009Fzz-6y for pgsql-hackers@lists.postgresql.org; Wed, 06 Dec 2023 12:46:37 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rArIO-00950G-UY for pgsql-hackers@lists.postgresql.org; Wed, 06 Dec 2023 12:46:34 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id E777C5C0197; Wed, 6 Dec 2023 07:46:30 -0500 (EST) Received: from imap49 ([10.202.2.99]) by compute2.internal (MEProxy); Wed, 06 Dec 2023 07:46:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eulerto.com; h= cc:content-type: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=fm2; t=1701866790; x=1701953190; bh=SX e//SeEAg43S3NXrrVZQjiQddF8oSeq4uehdqzQzL8=; b=l38Y5WJJt+AkoRLgSy OQoM3F2XPVFVE3VV05vy8Lg0mRGJ3WPnDRycMEAiERuYar46Wr+vxre880EP94td lRxDj7L9AwqkRv1xIBnsQYLfuVsr9kRy6MBMD3pdIFiSi3RcVljX6/rw02kHleW5 N6IaXHRvUxNVtHcs0Srk8FnKXW2f5J7q0MWLIO8p5hiMYXQjeu5zHcfdIYFKL0N7 FELjwUEIuHRsbkL1gM0XGwYu8WEnCZ/Vt5WmknzaDwyOf0wzPrU2ipKJEI23DPA7 d6li6FrxlSgR8n8sG/ZOaRsx3XB4jcpKNWYmS3u7Zvk7c6wN6/aGGY0kEa3k7r+m G3+Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1701866790; x=1701953190; bh=SXe//SeEAg43S 3NXrrVZQjiQddF8oSeq4uehdqzQzL8=; b=OtCppmA4VbzGt820sWn2bUqCcADWk GUd6/X6IRdQjKk5gdIPvuHAhShm8BcO8qxZmPWse9XRQlCSdjaYMc/7emVpbYor7 u0Ilx5Rkt+u6xPJVE1mNprRFxLE3LK2Q5HDh25+DQ+Y9RfH0lTPefmOGt2UdNlAK fNQ2ntE7dI1duxp8758DkPYgJUGrHShK70FW2xjBKzHAxnBI2xZ3KlDkcdNMgwG+ Uzlf4zX7Jg+llO6aHkKR2+BqIZp/PzbSpby/3eIZbYwGB55Ckvk/lb18CFzDzI0J 45k/KbC/M5ajwGWSwSSldrQNs2b2zfe/uKyEjwIH0ec/TtxvvD2BC0MGQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudektddggeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesrgdtreerreertdenucfhrhhomhepfdfguhhl vghrucfvrghvvghirhgrfdcuoegvuhhlvghrsegvuhhlvghrthhordgtohhmqeenucggtf frrghtthgvrhhnpeejtefhuedvgffftdetvedufedtjeeuffekleevkefhveekgeelfefh jeehtdejgeenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepvghulhgvrhesvghu lhgvrhhtohdrtghomh X-ME-Proxy: Feedback-ID: i0c21471d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 6224F15A0091; Wed, 6 Dec 2023 07:46:30 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1178-geeaf0069a7-fm-20231114.001-geeaf0069 MIME-Version: 1.0 Message-Id: In-Reply-To: <5a2e43da-0425-4fc1-9b13-19fd33123950@eisentraut.org> References: <5a2e43da-0425-4fc1-9b13-19fd33123950@eisentraut.org> Date: Wed, 06 Dec 2023 09:46:09 -0300 From: "Euler Taveira" To: "Peter Eisentraut" , "Bharath Rupireddy" , "PostgreSQL Hackers" Subject: Re: Is WAL_DEBUG related code still relevant today? Content-Type: multipart/alternative; boundary=168f2e2acb534bdcb570f882947d86e9 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --168f2e2acb534bdcb570f882947d86e9 Content-Type: text/plain On Wed, Dec 6, 2023, at 8:27 AM, Peter Eisentraut wrote: > On 02.12.23 15:06, Bharath Rupireddy wrote: > > I enabled this code by compiling with the WAL_DEBUG macro and setting > > wal_debug GUC to on. Firstly, the compilation on Windows failed > > because XL_ROUTINE was passed inappropriately for XLogReaderAllocate() > > used. > > This kind of thing could be mostly avoided if we didn't hide all the > WAL_DEBUG behind #ifdefs. AFAICS LOCK_DEBUG also hides its GUCs behind #ifdefs. The fact that XLOG_DEBUG is a variable but seems like a constant surprises me. I would rename it to XLogDebug or xlog_debug. > in the normal case. That way, we don't need to wrap that in #ifdef > WAL_DEBUG, and the compiler can see the disabled code and make sure it > continues to build. I didn't check the LOCK_DEBUG code path to make sure it fits in the same category as WAL_DEBUG. If it does, maybe it is worth to apply the same logic there. -- Euler Taveira EDB https://www.enterprisedb.com/ --168f2e2acb534bdcb570f882947d86e9 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
On Wed, Dec 6, = 2023, at 8:27 AM, Peter Eisentraut wrote:
On 02.12.23 15:06, Bharath Rupireddy wrot= e:
> I enabled this code by compiling with the WAL_DEBU= G macro and setting
> wal_debug GUC to on. Firstly, the= compilation on Windows failed
> because XL_ROUTINE was= passed inappropriately for XLogReaderAllocate()
> used= .

This kind of thing could be mostly avoide= d if we didn't hide all the 
WAL_DEBUG behind #ifdefs= .

AFAICS LOCK_DEBUG also hides= its GUCs behind #ifdefs. The fact that XLOG_DEBUG
is a va= riable but seems like a constant surprises me. I would rename it to
<= /div>
XLogDebug or xlog_debug.

in the normal case.  That wa= y, we don't need to wrap that in #ifdef 
WAL_DEBUG, a= nd the compiler can see the disabled code and make sure it 
continues to build.

I d= idn't check the LOCK_DEBUG code path to make sure it fits in the same
category as WAL_DEBUG. If it does, maybe it is worth to appl= y the same logic
there.


<= /div>
--
Euler Taveira

--168f2e2acb534bdcb570f882947d86e9--