| From: | Daniel Gustafsson <daniel(at)yesql(dot)se> |
|---|---|
| To: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> |
| Cc: | Japin Li <japinli(at)hotmail(dot)com>, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Osama Abdul Qader <osamaabdulqader(dot)cs(at)gmail(dot)com> |
| Subject: | Re: Fix detection of truncated zstd-compressed backups |
| Date: | 2026-10-08 22:36:03 |
| Message-ID: | 919CD514-1DB5-4BC0-9683-8E7B76FD6AFF@yesql.se |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
> On 7 Sep 2026, at 05:13, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
> PFA v9.
Sorry for returning to this late, things have been busy. I think v9 is pretty
much ready to go in, but I have a few small comments/questions.
- pg_fatal("could not uncompress data: %s", zp->msg);
+ pg_fatal("could not uncompress data: %s",
+ zp->msg ? zp->msg : "unknown error");
Is this change a precaution or fixing a known issue which can happen?
/* Lazy init */
if (!LZ4Stream_init(state, false /* decompressing */ ))
- {
- pg_log_error("unable to initialize LZ4 library: %s",
- LZ4F_getErrorName(state->errcode));
return -1;
- }
I understand the rationale for this change, but I don't think it's improving
things. As it stands now we are losing context in the messaging when all
errors say "can't read from input file", and the fread error cannot be captured
with LZ4Stream_get_error since fread doesn't set errno. The double log isn't
pretty, but getting worse errormessages isn't better so we need to stick with
it for now. A refactoring for 20 could be to pass down an error buffer and
psprintf the message there for the caller to log. This close to v20 RC I don't
want to redesign any part though.
The above point, along with minor cleanup and polish here and there is in the
attached v10.
--
Daniel Gustafsson
| Attachment | Content-Type | Size |
|---|---|---|
| v10-0001-Fix-detection-of-truncated-compressed-backups.patch | application/octet-stream | 10.2 KB |
| v10-0002-Fix-detection-of-truncated-zstd-and-LZ4-dump-dat.patch | application/octet-stream | 13.7 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | surya poondla | 2026-10-08 22:36:52 | Re: pg_walinspect: add functions to locate and list WAL by time and LSN |
| Previous Message | surya poondla | 2026-10-08 21:35:19 | Re: Incremental backups report progress as if they were full backups |