Re: pg_verifybackup: TAR format backup verification
Amul Sul <sulamul@gmail.com>
From: Amul Sul <sulamul@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Sravan Kumar <sravanvcybage@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>,
Andres Freund <andres@anarazel.de>
Date: 2024-08-02T11:43:02Z
Lists: pgsql-hackers
Attachments
- v5-0010-pg_verifybackup-Add-backup-format-and-compression.patch (application/x-patch) patch v5-0010
- v5-0011-pg_verifybackup-Read-tar-files-and-verify-its-con.patch (application/x-patch) patch v5-0011
- v5-0012-pg_verifybackup-Tests-and-document.patch (application/x-patch) patch v5-0012
- v5-0009-Refactor-move-first-and-last-progress_report-call.patch (application/x-patch) patch v5-0009
- v5-0008-Refactor-split-verify_control_file.patch (application/x-patch) patch v5-0008
- v5-0007-Refactor-split-verify_file_checksum-function.patch (application/x-patch) patch v5-0007
- v5-0005-Refactor-move-some-part-of-pg_verifybackup.c-to-p.patch (application/x-patch) patch v5-0005
- v5-0004-Refactor-move-few-global-variable-to-verifier_con.patch (application/x-patch) patch v5-0004
- v5-0006-Refactor-split-verify_backup_file-function.patch (application/x-patch) patch v5-0006
- v5-0003-Refactor-move-astreamer-files-to-fe_utils-to-make.patch (application/x-patch) patch v5-0003
- v5-0002-Refactor-Add-astreamer_inject.h-and-move-related-.patch (application/x-patch) patch v5-0002
- v5-0001-Refactor-Rename-all-bbstreamer-references-to-astr.patch (application/x-patch) patch v5-0001
On Thu, Aug 1, 2024 at 6:48 PM Amul Sul <sulamul@gmail.com> wrote: > > On Thu, Aug 1, 2024 at 1:37 AM Robert Haas <robertmhaas@gmail.com> wrote: > > > > On Wed, Jul 31, 2024 at 9:28 AM Amul Sul <sulamul@gmail.com> wrote: > > > Fixed -- I did that because it was part of a separate group in pg_basebackup. > > [...] > > Out of time for today, will look again soon. I think the first few of > > these are probably pretty much ready for commit already, and with a > > little more adjustment they'll probably be ready up through about > > 0006. > > > > Sure, thank you. > The v4 version isn't handling the progress report correctly because the total_size calculation was done in verify_manifest_entry(), and done_size was updated during the checksum verification. This worked well for the plain backup but failed for the tar backup, where checksum verification occurs right after verify_manifest_entry(), leading to incorrect total_size in the progress report output. Additionally, the patch missed the final progress_report(true) call for persistent output, which is called from verify_backup_checksums() for the plain backup but never for tar backup verification. To address this, I moved the first and last progress_report() calls to the main function. Although this is a small change, I placed it in a separate patch, 0009, in the attached version. In addition to these changes, the attached version includes improvements in code comments, function names, and their arrangements in astreamer_verify.c. Please consider the attached version for the review. Regards, Amul
Commits
-
Adjust json_manifest_per_file_callback API in one more place.
- 554d3a18f362 18.0 landed
-
File size in a backup manifest should use uint64, not size_t.
- d94cf5ca7fad 18.0 landed
-
Fix some pg_verifybackup issues reported by Coverity.
- fc1b2ce0ee9c 18.0 landed
-
pg_verifybackup: Move some declarations to new pg_verifybackup.h
- aa2d6b15d6d6 18.0 landed
-
pg_verifybackup: Move skip_checksums into verifier_context.
- af99d44a889f 18.0 landed
-
Improve file header comments for astramer code.
- 22b4a1b561f8 18.0 landed
-
Move astreamer (except astreamer_inject) to fe_utils.
- f80b09bac87d 18.0 landed
-
Move recovery injector astreamer to a separate header file.
- 53b2c921a0f9 18.0 landed
-
Rename bbstreamer to astreamer.
- 3c905698114d 18.0 landed