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 1vHOFj-005m7v-28 for pgsql-hackers@arkaria.postgresql.org; Fri, 07 Nov 2025 15:19:51 +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 1vHOFg-00F1nD-Lz for pgsql-hackers@arkaria.postgresql.org; Fri, 07 Nov 2025 15:19:48 +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 1vHOFg-00F1n5-Bm for pgsql-hackers@lists.postgresql.org; Fri, 07 Nov 2025 15:19:48 +0000 Received: from mail.postgrespro.ru ([93.174.132.70]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1vHOFb-005vHM-3B for pgsql-hackers@lists.postgresql.org; Fri, 07 Nov 2025 15:19:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1762528780; bh=a/XTm+XHgmBEAc7r2MVTGziz9pU2/SBQf+67WWsN71Y=; h=Message-ID:Date:User-Agent:Subject:From:To:References:In-Reply-To: From; b=cgvUIkvYthJJsW9Xtyd1GAaIZGLR/2LPrlXzdfyPTz+lmm4bWAJXqZZYYRj02kURB /UwRJG9TSDJcYGzRbCGf+aUw3I6IRP0Y9YvvzEaNbyjuSVaPpahW/oIHAMsA8aAUuZ mmRr1FVQi4mRuEB8xIPzdg5wg8+mdu2J4c252DQmVO1z14uNLNSPXQPQmCL484tHgE M9DIVRHMBuD3/pZYn4L+xsZjmfJqHyX+b9z+aHbdMai7XXzCbVn9zBHrq5moDWR0aG L8yCGaxTPlHxtXP7jSTnrKkw0xtkPyLMOvnJuqPazgN8OyiJQ7EKTyf5FrsGlRbWKV nvzxS9hCdQx9w== Received: from [10.9.2.81] (unknown [31.187.97.93]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: m.melnikov@postgrespro.ru) by mail.postgrespro.ru (Postfix/465) with ESMTPSA id 4A02660D59 for ; Fri, 7 Nov 2025 18:19:40 +0300 (MSK) Message-ID: Date: Fri, 7 Nov 2025 18:19:39 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Incorrect checksum in control file with pg_rewind test From: "Maksim.Melnikov" To: pgsql-hackers@lists.postgresql.org References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed X-KSMG-AntiPhishing: NotDetected, bases: 2025/11/07 14:50:00 X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.1.0.7854, bases: 2025/11/07 13:11:00 #27892375 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: not scanned, disabled by settings X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 1 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, just to clarify, it isn't pg_rewind related issue and can fire=20 spontaneously. I don't have any strong scenario how to reproduce it, tests sometimes=20 fired on our local CI, but as you can see on thread [1], where the same issue for frontends was discussed, it is very hard to=20 reproduce and there wasn't scenario how to do it too. Some dirty hacks to reproduce it was described here [2], and I've tried=20 it on master branch: First of all I applied patch=20 0001-XXX-Dirty-hack-to-clobber-control-file-for-testing.patch from [2],=20 then compile app with -DEXEC_BACKEND and exec command in psql do $$ begin loop perform pg_update_control_file(); end loop; end; $$; Also I've run pgbench command for run in {1..5000}; do pgbench -c50 -t100 -j6 -S postgres ; done And eventually got error 2025-11-07 17:58:33.139 MSK [2472504] FATAL:=C2=A0 incorrect checksum in=20 control file 2025-11-07 17:58:33.141 MSK [2472501] LOG:=C2=A0 could not receive data f= rom=20 client: Connection reset by peer 2025-11-07 17:58:33.143 MSK [2472505] LOG:=C2=A0 could not send data to=20 client: Broken pipe 2025-11-07 17:58:33.143 MSK [2472505] FATAL:=C2=A0 connection to client l= ost Best regards, Maksim Melnikov [1]=20 https://www.postgresql.org/message-id/flat/20221123014224.xisi44byq3cf5ps= i%40awork3.anarazel.de [2]=20 https://www.postgresql.org/message-id/CA%2BhUKGK-BEe38aKNqHJDQ86LUW-CMwF5= F9bo1JtJVg71FoDv_w%40mail.gmail.com [3]=20 https://www.postgresql.org/message-id/f59335a4-83ff-438a-a30e-7cf2200276b= 6%40postgrespro.ru