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 1ujRs0-007m3I-Az for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Aug 2025 00:19:04 +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 1ujRrz-00CoaZ-88 for pgsql-hackers@arkaria.postgresql.org; Wed, 06 Aug 2025 00:19:03 +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 1ujRry-00CoaQ-Bk for pgsql-hackers@lists.postgresql.org; Wed, 06 Aug 2025 00:19:02 +0000 Received: from fhigh-b7-smtp.messagingengine.com ([202.12.124.158]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ujRru-000xhF-2b for pgsql-hackers@lists.postgresql.org; Wed, 06 Aug 2025 00:19:02 +0000 Received: from phl-compute-07.internal (phl-compute-07.phl.internal [10.202.2.47]) by mailfhigh.stl.internal (Postfix) with ESMTP id CF2D47A01C7; Tue, 5 Aug 2025 20:18:55 -0400 (EDT) Received: from phl-imap-05 ([10.202.2.95]) by phl-compute-07.internal (MEProxy); Tue, 05 Aug 2025 20:18:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eulerto.com; h= cc:cc:content-transfer-encoding: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=fm1; t=1754439535; x=1754525935; bh=6vZBhFz50ERAylC+qBAxa9XT5x45T/xcg5YGq5MBu0s=; b= TXS29qYcfNUd/XyZ6dEPRgcFguFrRnP+gpR6eKOxbfcoRVVqPcfkJPZa6XYra7OQ 3ks/sOy4RjiEvPMNo7oF4oawSW/OXbjt0I+DgRUH0I/Joz/03NWIP5ctGBCYglp2 YZVHBIU5B4Nwlm/5MttuqJMxVdrlY0tBu20s1nAVk9+WOMPiDAAcTGnMXodkBqE8 PEYSO8JHPKPy9lMpRdkLXBtfJXbLRpkGjY9oHyydOSOz9x3mhvQojKyKHtqAQ8cc v4CU49llVyG5mhdEKVC9Glsen3phRuWVDlJvq07y473dyxiarooJvy4Vj7AY3KX5 5jGAY5Ur0486jZ7fWct1yQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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-sender:x-me-sender:x-sasl-enc; s=fm3; t=1754439535; x= 1754525935; bh=6vZBhFz50ERAylC+qBAxa9XT5x45T/xcg5YGq5MBu0s=; b=Z dSuF8xIfJusX02YJz+MGb1ZWB8z+y7nmCFcvMGLV7d6ivdE0+BAiYca814dEqpUT 6tASOlafAT35TwkR6E/jK+hs/LwUbtz8OFp6+3QwB6I4zSOp/xLmmGFJTK3idKIE pAQ760TAscQlwMjc3kDwy9/WM0qEFKkMfEBQWS8bjWHpiz3OzlUmajsichj9yHI6 FbQCHQs4O1yfc8r1raUwOeRxvH0iuHPtPR/v4d3OX56v0swqPRwb1P/TKX0DngGd mk8hLsJJ+ULxmu7ePb+5uaMiuoz8Vd18o1e1HQnaoqgcMs+MwaCeFr67fLv3s77k 8O6cC9leCEmvSkoZRHTvA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdduudeiheelucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvfevkfgjfhfutgfgsehtjeertdertddtnecuhfhrohhmpedfgfhulhgv rhcuvfgrvhgvihhrrgdfuceovghulhgvrhesvghulhgvrhhtohdrtghomheqnecuggftrf grthhtvghrnhepleevgfeileegfffglefgfeefffeghfefvdeftdduvdffieeijeffudel iefhvdevnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegvuhhlvghrsegvuhhl vghrthhordgtohhmpdhnsggprhgtphhtthhopeehpdhmohguvgepshhmthhpohhuthdprh gtphhtthhopehjrggtohgsrdgthhgrmhhpihhonhesvghnthgvrhhprhhishgvuggsrdgt ohhmpdhrtghpthhtohepuggrvhgvtghrrghmvghrsehgmhgrihhlrdgtohhmpdhrtghpth htohepnhgrthhhrghnuggsohhsshgrrhhtsehgmhgrihhlrdgtohhmpdhrtghpthhtohep rghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvpdhrtghpthhtohepphhgshhqlhdqhh grtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i0c21471d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 42D731820074; Tue, 5 Aug 2025 20:18:55 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: T85d7d18731a25a64 Date: Tue, 05 Aug 2025 21:18:34 -0300 From: "Euler Taveira" To: "Nathan Bossart" , "Jacob Champion" Cc: =?UTF-8?Q?=C3=81lvaro_Herrera?= , "Dave Cramer" , "PostgreSQL Hackers" Message-Id: <797cad77-647b-42c4-89b8-fd5bf8a8fd10@app.fastmail.com> In-Reply-To: References: <202508041231.myxuzx2udlze@alvherre.pgsql> Subject: Re: More protocol.h replacements this time into walsender.c Content-Type: text/plain Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Aug 5, 2025, at 4:58 PM, Nathan Bossart wrote: > Here is an updated patch that includes 1) added uses of PqMsg_* macros, 2) > new PqReplMsg_* macros, and 3) new PqBackupMsg_* macros. Thoughts? > - * 'd' means a standby reply wrapped in a CopyData packet. + * CopyData means a standby reply wrapped in a CopyData + * packet. */ Shouldn't it be PqMsg_CopyData instead of CopyData (first reference)? The function LogicalParallelApplyLoop() has /* * The first byte of messages sent from leader apply worker to * parallel apply workers can only be 'w'. */ c = pq_getmsgbyte(&s); if (c != 'w') elog(ERROR, "unexpected message \"%c\"", c); it needs to be adjusted. The function XLogWalRcvProcessMsg() has switch (type) { case 'w': /* WAL records */ { StringInfoData incoming_message; ... case 'k': /* Keepalive */ { StringInfoData incoming_message; it also needs to be adjusted. There is also some references into receivelog.c. The functions sendFeedback() and HandleCopyStream() contain some references to be replaced. There are other functions too that refers to these replication codes on comments. It seems a good idea to replace these references too. There are also some references in pg_recvlogical.c. The functions sendFeedback() and StreamLogicalLog() contain some references to be replaced. Alvaro already pointed out the other cases in the pg_basebackup.c file. May I suggest that you put these code before authentication codes? It seems natural to have these new codes near the existing ones. For the reference, I used grep -r -E "'[a-z]'" in some directories to catch these cases. It is a bit off-topic for this thread but looking at the replication protocol messages, a different pattern is used for naming the messages such as WALData Primary keepalive message Standby status update Hot standby feedback message new archive manifest archive or manifest data progress report I would expect to see the same pattern (Pascal case) as the wire protocol. AuthenticationSASLFinal BackendKeyData Bind -- Euler Taveira EDB https://www.enterprisedb.com/