Re: pg_verifybackup: TAR format backup verification - Mailing list pgsql-hackers

From Robert Haas
Subject Re: pg_verifybackup: TAR format backup verification
Date
Msg-id CA+TgmoZ-WRWEuWcTb-g8_gc68PivR+rJ7q-yujqDtgFOo1p+Bg@mail.gmail.com
Whole thread Raw
In response to Re: pg_verifybackup: TAR format backup verification  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pg_verifybackup: TAR format backup verification
List pgsql-hackers
On Mon, Sep 30, 2024 at 11:31 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> WFM, modulo the suggestion about changing data types.

I would prefer not to make the data type change here because it has
quite a few tentacles. If I change member_copy_control_data() then I
have to change astreamer_verify_content() which means changing the
astreamer interface which means adjusting all of the other astreamers.
That can certainly be done, but it's quite possible it might provoke
some other Coverity warning. Since this is a length, it might've been
better to use an unsigned data type, but there's no reason that I can
see why it should be size_t specifically: the origin of the value
could be either the return value of read(), which is ssize_t not
size_t, or the number of bytes returned by a decompression library or
the number of bytes present in a protocol message. Trying to make
things fit better here is just likely to make them fit worse someplace
else.

"You are in a maze of twisty little data types, all alike."

--
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: pg_verifybackup: TAR format backup verification
Next
From: Daniel Gustafsson
Date:
Subject: Re: pg_upgrade check for invalid databases