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 1vMPZd-0093N0-2y for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Nov 2025 11:45:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vMPZc-006yqP-1F for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Nov 2025 11:45:08 +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 1vMPZc-006yqH-0H for pgsql-hackers@lists.postgresql.org; Fri, 21 Nov 2025 11:45:08 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vMPZa-000iME-1I for pgsql-hackers@lists.postgresql.org; Fri, 21 Nov 2025 11:45:08 +0000 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-343806688c5so1753400a91.0 for ; Fri, 21 Nov 2025 03:45:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763725504; x=1764330304; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=yaI0X8uMEzETpMtkNmfQWQEBVH1G5prwd6Tzw/9njGc=; b=bJX7YYLNPUMO4YvXMyxvznALKf0qLgcgr+c92WrOtPHBZjWSOZunCbFn2ffNqxhDAV yOA9U01ya8uLetje31TvML+68LC4ZeGFKA+hQM9Fb3PxMFmR+oShCFJ0eERzfkDtXo9i 6wPA62dx6lvjAVO9aE0bbyC7G2JDaHt5YBGa/m/vIT7ZyCY3eAgS40VxUkDmego4sJYN HppwTFy5ClHdHHVo322WMdQ0JKHDYBwcmZ3qVQ+6aZX8pq8VsLHg9/mcRDnmOKvmgaTG lQiLU06BArfhNXcl4MjHZiNpSwug1cg3z/a4xnVtn2nt0xxFa802NgMn1NueuKBrQ3QT icRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763725504; x=1764330304; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=yaI0X8uMEzETpMtkNmfQWQEBVH1G5prwd6Tzw/9njGc=; b=IIIiqnh/lQ/eNM0PZMbeyO5pU7G+YqJx7Us3EKcMbNCamA2Znfyx93vOlkREF6KWjK MIzrDynDQQHBvB6xsOiJO475gU6yA8aZIBTObFC2OyYapzztFoeKShNykoLBrGoUpIfo gxxmSK4LyQD/C+8Uw3eXe+q0MxPVXbVK4XJ3H3GFbIcK+MgjQgmo6rK9XbWOl1E7mA6M 7PiSAoJE/VN1xO7r0E4d5W6OXnRERrI/yYQy2HYK6kpLwIC6PhyTsFsPrt8NupHC50Mq ezuIHNoAq91NKXUEivb+uqAHEbcKSWzX/QLoVVm2EKYTAnO2+fphXEkimcW8reEbCUSB iLZg== X-Forwarded-Encrypted: i=1; AJvYcCWS1g1HMUf0LakbjmKru9k5MHFUhI/RzHdWYNaFZwqGQfcCOdVLVcBj5tE1GVZ3xwuVpLCEpSbwKyBnsoqU@lists.postgresql.org X-Gm-Message-State: AOJu0YzK0NSMkTgzFiki2g+c1QrSR9XdD9jGAAO/09JvQ02L/8eu7PMa 7sDylbfHSzE8w456hDKBpyhKXF+P49dD5tmTwb073guoaY6+C+LZ/WqvX5P6mka4Rx3ZDSLgMZV EYaKEsQPfKy0M5zRKUfq40QQ2SmyUGGw= X-Gm-Gg: ASbGncvItg+2JGvJqmhhq7L571qX2bsloIclaBlrqX9nsILZ+kJ0hvs+andO+gSLSSa A9soW5ZHvmFitsXdfalSbKBPGmb0o5m9nFy1fvUSmJwQ0Biu7tUX9V60Nxx9tGS8ctsrJwpjXsi PrmcYn1WNvpLgSVa6iy7m7RyXZ1IT6Cfghe1vNBKaQyze6JN18MaqbFuS9sheCK2HVU4SZFtDcw HZGc4165ry0PSslD478JZ4jml3xGFgG4OKitPEywoLtm8kPydPDxWh5LW//ZQZTAXnIIEPerw== X-Google-Smtp-Source: AGHT+IFyEvn5W7p7RUgVtw/vKbeKZEFeE6I+y1SRYom+pWSTsNTLSRB3hM+Yd5xF+gL90QiSpMytaOd/EudHUBg/Rpo= X-Received: by 2002:a17:90b:2d8d:b0:340:5b6a:5bb0 with SMTP id 98e67ed59e1d1-34733f2a416mr2377541a91.26.1763725503818; Fri, 21 Nov 2025 03:45:03 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Amul Sul Date: Fri, 21 Nov 2025 17:14:26 +0530 X-Gm-Features: AWmQ_bk9Q9dGMkr4tcRTfN-VV-AXDTrq16T5vvlc9DfXh5LqR7eRlsWUysQw0gU Message-ID: Subject: Re: pg_waldump: support decoding of WAL inside tarfile To: Jakub Wartak Cc: Robert Haas , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Nov 19, 2025 at 1:50=E2=80=AFPM Jakub Wartak wrote: > > On Mon, Nov 17, 2025 at 5:51=E2=80=AFAM Amul Sul wrot= e: > > > > On Thu, Nov 6, 2025 at 2:33=E2=80=AFPM Amul Sul wro= te: > > > > > > On Mon, Oct 20, 2025 at 8:05=E2=80=AFPM Robert Haas wrote: > > > > > > > > On Thu, Oct 16, 2025 at 7:49=E2=80=AFAM Amul Sul wrote: > > > > [....] > > > Kindly have a look at the attached version. Thank you ! > > > > > > > Attached is the rebased version against the latest master head (e76defb= cf09). > > Hi Amul, thanks for working on this. I haven't really looked at the > source code deeply (I trust Robert eyes much more than mine on this > one), just skimmed a little bit: > > 1. As stated earlier, get_tmp_walseg_path() is still vulnerable (it > uses predictable path that could be used by attacker in $TMPDIR) > Yeah, I haven't done anything regarding this since I am unsure of what should be done and what the risks involved are. I am thinking of taking Robert's opinion on this. > 2. On the usability front: > > a. If you do `pg_waldump --path pg_wal.tar -s 0/31000000` it will dump > a lot of WAL records and then print final: > pg_waldump: error: could not find file "000000010000000000000034" in arch= ive > > However, with `pg_waldump --path pg_wal.tar -s 0/31000000 > --stats=3Drecord` (not passing '-e') it will simply bailout without > printing stats and with error: > pg_waldump: error: could not find file "000000010000000000000034" in arch= ive > > IMHO, it could print stats if it was capable of getting at least 1 WAL re= cord. > The similar behavior in the current pg_waldump when using the --path option with a WAL directory and a starting LSN. E.g: $ pg_waldump -s 0/04FE36E0 --path=3D/tmp/backup/tmp/ --stats=3Drecord pg_waldump: first record is after 0/04FE36E0, at 0/04FE3F90, skipping over 2224 bytes pg_waldump: error: could not find file "000000010000000000000009": No such file or directory > 3. The most critical issue for me was the initial lack of error > pass-through from pg_waldump (when used with WALs in tar) to the > pg_verifybackup. Now it works fine, so thanks for this: > Thanks, that was exactly the intention -- to complete pg_verifybackup for tar-formatted backup verification. Regards, Amul