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+TgmoZw9dc6w-FFFJvuFMEfB11c+tDRyW+BjWD89+NG8bV=iA@mail.gmail.com
Whole thread Raw
In response to Re: pg_verifybackup: TAR format backup verification  (Amul Sul <sulamul@gmail.com>)
Responses Re: pg_verifybackup: TAR format backup verification
List pgsql-hackers
On Wed, Aug 7, 2024 at 1:05 PM Amul Sul <sulamul@gmail.com> wrote:
> The main issue I have is computing the total_size of valid files that
> will be checksummed and that exist in both the manifests and the
> backup, in the case of a tar backup. This cannot be done in the same
> way as with a plain backup.

I think you should compute and sum the sizes of the tar files
themselves. Suppose you readdir(), make a list of files that look
relevant, and stat() each one. total_size is the sum of the file
sizes. Then you work your way through the list of files and read each
one. done_size is the total size of all files you've read completely
plus the number of bytes you've read from the current file so far.

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



pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: Remaining dependency on setlocale()
Next
From: Robert Haas
Date:
Subject: Re: pgsql: Introduce hash_search_with_hash_value() function