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 1wA2kS-0020l3-02 for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Apr 2026 09:29:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wA2kQ-00GFkz-1Z for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Apr 2026 09:29:26 +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 1wA2kQ-00GFkq-0Z for pgsql-hackers@lists.postgresql.org; Tue, 07 Apr 2026 09:29:26 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wA2kO-000000014OB-09An for pgsql-hackers@lists.postgresql.org; Tue, 07 Apr 2026 09:29:26 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-43cfbd17589so3733143f8f.0 for ; Tue, 07 Apr 2026 02:29:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1775554163; x=1776158963; darn=lists.postgresql.org; h=message-id:date:content-transfer-encoding:content-id:mime-version :comments:references:in-reply-to:subject:cc:to:from:from:to:cc :subject:date:message-id:reply-to; bh=AlnK48Q+LGhGv2rcQULSzdIXR64zlelXv0N+QQqhcZ4=; b=TQdMkyz248Hw2ng8RzNBUE/ulME5BwnspEf0YrqS+d/tLowxmNblOlLS+7khaAmWgo oFIqHgxFd/qicH0dYGGpOF4yD3+K2ENcdmnmwpQzlqiz9LnpGyW7q26v24gPyPK1lq/U SeQxYQEBetvcjOWhHV6tSKWMH7Zf9u5sBb0NdIjW/6cybviE47GX6SB/TO1WweCQKRyE cnb3chIEmSCBo4AeZgZryH567NnAGPk9AttqbIF75utIkTDLP/78zLYBrTv2xVFlfV4y waCQIcJthhRuknmTY+tZpnJLhFKknjQGRn57EtdwEaJ6MkW+HZlVeXWqPVlC1kLpXabC LNaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775554163; x=1776158963; h=message-id:date:content-transfer-encoding:content-id:mime-version :comments:references:in-reply-to:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AlnK48Q+LGhGv2rcQULSzdIXR64zlelXv0N+QQqhcZ4=; b=WuwkyZZGy5xQGKiyROMgtMFkjgt8plFJYiHcdw8+wr+2MyxMEMHeH+jAFE1ZbIkc1X rDFYjlKhWe1tTpivPRIdNqQQL/A3sVUtFtIcF0ljgW1GEZTO1C1dP2lJpq3O6CCcok3t 4JoN+cTyGBrbkEIEsXf5pRF5D6tc6U75a7cgNEw8QsnIsY1yXQe00a4iE1GjLR48/kt9 UPfEZRgEDVHTEz0SOzvSEsIOBtuHArkCW36AqBZ6hF4nULpfKPklSwgKCZ5TzxLaUc63 VPEzFWWyW/VL46TnxLsYAZGLKg/0zHeR67qFk6YEmJ0FZ3F4FsgWuwo57B142wTQU+17 /ErA== X-Forwarded-Encrypted: i=1; AJvYcCWfb7cLzmtVnRbAVBwt+YraxfmFzWjLsmrvtFBDhL96LRr08DIBfbAmh+Edso41JU2Hwfpg1Fi2Qzo+US+c@lists.postgresql.org X-Gm-Message-State: AOJu0Yw4nLFiuYZ9eRynxYmlQhM557em1rwpBBm2WMy0ojuz/QMOdQQp eGI2P46nmUQxgTQDO3jERd8yZpVSugZ4IJxq0gzPMI2gbKYiK7gezqz/ef3Trw4Pa1Q= X-Gm-Gg: AeBDiev1OOMcFTwoE1ox5vmaW0lBaMI5HCKXgzCnDGRNn0RwTSweWsu9FfMxBWMImDq LmfJwsQTdHtx00mHCYnJL5gPKadOrQRmilfZ3W5AL9paLVtwQlbQeIkO+WPT5tq5X8ahMuREgZr EPriePwcmkxxUGhFzxRxj/9PefLBoFoiAPWpuhvP5vLHEu15YP3mevlPsvLy8t4dILFnYf2FNxB 37yOAdexRQ5IemNmJHsg4KA5Q5R86oOj8efzLgkiGW7pMhqILTQ6FS4XLOx124RipfebdIUZQlO hADtPwf1dI+E0ImvA31xAn9iELfddpur23+Is9QQMCZtFRxiT9Tja3owBgjlEoMWWUK4IzoHSeE /pcWho9OQT0P5ZJef6HGhDZKK4QaNBEw29/YRKpyl2aZ6hdvtrz5/ARoBt+YWCZzToxUpcNW9iF KCXk14Sd8juSKCNIfuOVCrT5B1oEiRMWA3X6wU X-Received: by 2002:a05:6000:186c:b0:43b:41df:705e with SMTP id ffacd0b85a97d-43d2930fc4fmr23591550f8f.49.1775554163152; Tue, 07 Apr 2026 02:29:23 -0700 (PDT) Received: from localhost (109-81-168-142.rct.o2.cz. [109.81.168.142]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43d1e2c5468sm47822947f8f.13.2026.04.07.02.29.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Apr 2026 02:29:22 -0700 (PDT) From: Antonin Houska To: Srinath Reddy Sadipiralla Cc: Tom Lane , Andres Freund , Noah Misch , Alvaro Herrera , vignesh C , Amit Kapila , Mihail Nikalayeu , Matthias van de Meent , Pg Hackers , Robert Treat Subject: Re: Adding REPACK [concurrently] In-reply-to: <188275.1775552266@localhost> References: <202604060918.qw5ms7cbr2hz@alvherre.pgsql> <20260407011056.50.noahmisch@microsoft.com> <1976915.1775537087@sss.pgh.pa.us> <188275.1775552266@localhost> Comments: In-reply-to Antonin Houska message dated "Tue, 07 Apr 2026 10:57:46 +0200." X-Mailer: MH-E 8.6+git; nmh 1.8; GNU Emacs 28.3 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <192672.1775554157.1@localhost> Content-Transfer-Encoding: quoted-printable Date: Tue, 07 Apr 2026 11:29:17 +0200 Message-ID: <192673.1775554157@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Antonin Houska wrote: > Srinath Reddy Sadipiralla wrote: > = > > i looked into this , it seems like valgrind catches the uninitialised = padding bytes, which > > repack worker is writing using BufFileWrite, it seems this fix solved = the problem. > > = > > diff --git a/src/backend/utils/time/snapmgr.c b/src/backend/utils/time= /snapmgr.c > > index 2e6197f5f35..f5682b87626 100644 > > --- a/src/backend/utils/time/snapmgr.c > > +++ b/src/backend/utils/time/snapmgr.c > > @@ -1739,6 +1739,8 @@ SerializeSnapshot(Snapshot snapshot, char *start= _address) > > = > > Assert(snapshot->subxcnt >=3D 0); > > = > > + MemSet(&serialized_snapshot, 0, sizeof(SerializedSnapshotData)); > > + > > /* Copy all required fields */ > > serialized_snapshot.xmin =3D snapshot->xmin; > > serialized_snapshot.xmax =3D snapshot->xmax; > > = > > thoughts? > = > Could you reproduce the failure in your environment? > = > I haven't thought of this explanation because BufFileWrite() only copies= the > data to a buffer in the BufFile structure and BufFileDumpBuffer() writes= the > buffer. Maybe valgrind is able to track the copying? Given this message, you may be right: =3D=3D1617044=3D=3D Address 0x12d745e2 is 106 bytes inside a block of siz= e 8,272 client-defined In my environment, the 'buffer' field starts at offset 80 into the BufFile structure. We first write 8 bytes into it BufFileWrite(file, &snap_size, sizeof(snap_size)); followed by the snapshot. Since sizeof(SerializedSnapshotData) is 24, the offset 106 should be the padding following the 'takenDuringRecovery' field= . -- = Antonin Houska Web: https://www.cybertec-postgresql.com