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 1uxAMj-00BWyo-Tg for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Sep 2025 20:27:29 +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 1uxAMh-003ptc-QF for pgsql-hackers@arkaria.postgresql.org; Fri, 12 Sep 2025 20:27:28 +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 1uxAMh-003ptU-En for pgsql-hackers@lists.postgresql.org; Fri, 12 Sep 2025 20:27:28 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uxAMe-000Tz3-0I for pgsql-hackers@lists.postgresql.org; Fri, 12 Sep 2025 20:27:27 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-b00a9989633so434789066b.0 for ; Fri, 12 Sep 2025 13:27:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757708839; x=1758313639; 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=swMt9m8ZqF9UWCDkFjJv3bJJV1y4y1jvGA5baBiea0c=; b=NVfZrXDvWbKrsWgeIXaB9S4xWxjTm5RSRa/Oc2TqgFN26hQk+tHoUCMgSysoEChmuN oS46qclusYrSju65IaFTujupxRMLhx8OdoKM8NS+tdvaE38G/sQMUB79RvFFBj6KdSvI iTnUCceerNGC7rqW6qqXBCMLAm9rWOG1sYbTzIgswyTVr0fwXBaTTZYKs7qyAImFHiUk HAyEve1UnQ2PQsEWJ/8FcBp6XFPSKrBXBh/Jyb/GYzeot9yeq4wxpvswIKOE3lpnPH/l y3cyE8YyGzPCnkVxmdHq5Y4eO7G6/aIb13ITlpP524xxtlNLm/VNc9i1oS+iVbpXRei0 +d8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757708839; x=1758313639; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=swMt9m8ZqF9UWCDkFjJv3bJJV1y4y1jvGA5baBiea0c=; b=rP3HSXG1yPjd/+w2BG3+EpCfhGtQXV/FhPYzgsgl0vNzUfg3Gg8KJIOtddWfxmOtun syJy4uIsPGb7zLiQj44H6/NQqhfsf03ayq+PbN/UvNs2rYX153qtR8AteDjYSmC7/y1y wwQl1OR/b9w7rfgToYnwdZhjft9UezhTrWzsnlCBURoLC+og3K+m81uVccTOrAZi5bBJ xjFOZ7JSx3JLE9nYmLENJ6kiAq1+xtPTUelx3Go4/vs+OsS1TLLh1s20mHFapq4znfgT C9XomIiLgrQj95IpfY9tXvqX9gzlTIx+KscAMzmGgV6uREy9DuB2FHA/BPvRWBc4vBVS zjGg== X-Gm-Message-State: AOJu0YziBVkAEbrm1U6JwN0dAmkS8g0PHUD1AY2c4Mf72XogV4c5sDQh jiQY99kOEYvQkGwre47eFgKyGSOQeC7vmZ9q7fZl3Bw9t5oB3mxsg4A/hlb4krO/Y+MP37J1MMK mv68X+9csBCjVbjr33ajcEK1D51iac0l6CQ== X-Gm-Gg: ASbGncuhugnK2T3HvdN4gvDevknqab1I7BQKaAxdweg/oKTtpz7NWLVkY7jBU73UAjK xfs/7d1HPOIROG3OsVI41rJCI4GYK4RI6tF/UQmFYpX/PVNzUSddyGlkK6FWPuP0A4yNkISH8bI a0NWuFebmtzjkh9TJ9N4J8i+J4YSlm8wLuebtEcXgfGMTvV2KsbNeevNwCFfFfxGTNYNskkTa9D X2/5dCCx5+QJkOI5PUfEE6+YYSN X-Google-Smtp-Source: AGHT+IGmBAj7G4HAW5f5Z+E+u5MavZE8unA5YyEUZxuiV5GVXD0XDhIAErsfwFert26oNmOFo8w1HMN6NY7/kCMZjfE= X-Received: by 2002:a17:907:3d87:b0:b04:1d85:7106 with SMTP id a640c23a62f3a-b07a64809a8mr762647666b.21.1757708839141; Fri, 12 Sep 2025 13:27:19 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Robert Haas Date: Fri, 12 Sep 2025 16:27:07 -0400 X-Gm-Features: Ac12FXx2dkWhJfM5qY9WcYmSb_LOctqHMZlr-UTr8LcUCyHCwdFh9X5VnVbPZjQ Message-ID: Subject: Re: pg_waldump: support decoding of WAL inside tarfile To: Amul Sul Cc: 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 Fri, Sep 12, 2025 at 2:28=E2=80=AFPM Robert Haas = wrote: > Is there a real need to pass XLogDumpPrivate to astreamer_wal_read or > astreamer_archive_read? The only things that they need are archive_fd, > archive_name, archive_streamer, archive_streamer_buf, and > archive_streamer_read_ptr. In other words, they really don't care > about any of the *existing* things that are in XLogDumpPrivate. This > makes me wonder whether we should actually try to make this new > astreamer completely independent of xlogreader. In other words, > instead of calling it astreamer_waldump() or astreamer_xlogreader() as > I proposed above, maybe it could be a completely generic astreamer, > say astreamer_stringinfo_new(StringInfo *buf) that just appends to the > buffer. That would require also moving the stuff out of > astreamer_wal_read() that knows about XLogRecPtr, but why does that > function need to know about XLogRecPtr? Couldn't the caller figure out > that part and just tell this function how many bytes are needed? Hmm, on further thought, I think this was a silly idea. Part of the intended function of this astreamer is to make sure we're only reading WAL files from the archive, and eventually reordering them if required, so obviously something completely generic isn't going to work. Maybe there's a way to make this look a little cleaner and tidier but this isn't it... --=20 Robert Haas EDB: http://www.enterprisedb.com