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 1wMiW6-000I3d-0r for pgsql-hackers@arkaria.postgresql.org; Tue, 12 May 2026 08:31:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wMiW4-003zbD-1l for pgsql-hackers@arkaria.postgresql.org; Tue, 12 May 2026 08:31:00 +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 1wMiW4-003zb5-0K for pgsql-hackers@lists.postgresql.org; Tue, 12 May 2026 08:31:00 +0000 Received: from mail.postgrespro.ru ([93.174.132.70]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wMiW1-00000000Bft-0uow for pgsql-hackers@lists.postgresql.org; Tue, 12 May 2026 08:30:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1778574656; bh=y9xgaYLHFE0jaj3SRfyW45D93YFdfMYuUyYSTWhFctQ=; h=Message-ID:Date:User-Agent:Subject:To:Cc:References:From: In-Reply-To:From; b=jgQYuxBa7bm5y0a/MlOJLvIUQWbLew7zOPws2Q/6p1JeTVTuukm3LK3i9Wv60MIOa QqEKfs/hNC4+95KHb7SNbztEuTjdm+Ns+dHoP1kKeSPdhZn66KZzZAKY2euopTWCFo JZko7h6qa4QgCAI+nIUJT9j/VRkT0TMGUmeaf4iYWmA0hB6uGWig6ijF0l+9FUlarP jCzhDAp9ztxefPiLwh4sG8EdZrYKhHFy5DQWoXOxwG0AzhPvKYNAqMGsLbhrqoGTOt iAe+Eahj80KFiCAIir5IqILz3ER4lS04FadtQvzzDgX+GM4qei7Y9l6ylqvDnqctxp Ep2vGQJBKpi2A== Received: from [10.9.2.114] (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 07AE65FFF5; Tue, 12 May 2026 11:30:56 +0300 (MSK) Message-ID: <4ff7bf45-3a95-471a-8dc2-84a8a3b3924a@postgrespro.ru> Date: Tue, 12 May 2026 11:30:55 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Incorrect checksum in control file with pg_rewind test To: Alexander Korotkov Cc: pgsql-hackers@lists.postgresql.org References: Content-Language: en-US From: "Maksim.Melnikov" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-KSMG-AntiPhishing: NotDetected X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 3.0.0.9059, bases: 2026/05/12 05:20:00 #28526803 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: not scanned, disabled by settings X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 4/21/26 15:12, Alexander Korotkov wrote: > Thank you for spotting this issue and proposing a patch. The fork > builds don't have this problem, because fork replicated contents of > LocalControlFile to the new process. And the postmaster has > consistent snapshot of control file as there is no concurrent process > which could write it and that moment. But EXEC_BACKEND, even with > your patch, may end up different processes with different contents of > LocalControlFile. I don't see it could cause a material bug right > now, but I see this as undesirable divergence between fork and > EXEC_BACKEND behaviors. I propose an alternative approach copy the > contents of control file to the new process via BackendParameters. > This approach solves two problems at once: no torn reads, and no > divergence between fork and EXEC_BACKEND. Hi, Alexander! Thanks for response! Your patch LGTM. Best regards, Maksim Melnikov