[pbs-devel] [PATCH v3 proxmox-backup 00/10] fix catalog dump and shell for split pxar archives

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Oct 21 16:07:15 CEST 2024


Am 12/08/2024 um 12:31 schrieb Christian Ebner:
> This patch series fixes the `catalog dump` and `catalog shell`
> commands for snapshots created by setting the `change-detection-mode`
> to either `data` or `metadata`, therefore using split pxar archive
> encoding without encoding the dedicated catalog.
> 
> If no catalog file can be found in the snaphsots manifest, the fallback
> behaviour is now to check if there are metadata archives present in the
> manifest, and if so use the metadata archive accessor for either
> dumping the contents in a format compatible to the catalog dump or to
> interactively navigate and restore contents via the catalog shell.
> 
> Changes since version 2 (thanks to Fabian for the comments and
> suggestions):
> - Move and factor out helpers to pxar/tools submodule instead of using
>   the tools module, which is for more generally client tools.
> - Improve error handling in catalog shell by avoiding unwrap of missing
>   directory stack entries, bail instead.
> - fix issue with factoring out of `entry_path_with_prefix` helper
> - Convert to `DirEntryAttribute` by implementing the `TryFrom` trait,
>   replacing previous helper.
> 
> Changes since version 1:
> - Implement also the `catalog shell` command for split pxar archives
> - Factor out common functionality into dedicated helpers
> 
> Christian Ebner (10):
>   client: tools: make tools module public
>   client: pxar: move catalog lookup helper to pxar tools
>   client: tools: move pxar root entry helper to pxar submodule

no hard feelings but maybe do a s/sub// to avoid making it sound
like this is git submodule related (but I might just have to much
exposure to the git ones to be "triggered" by just reading submodule
;-)

>   client: make helper to get remote pxar reader reusable
>   client: tools: factor out entry path prefix helper
>   client: tools: factor out pxar entry to dir entry mapping
>   client: add helper to dump catalog from metadata archive
>   client: catalog: fallback to metadata archives for catalog dump
>   client: helper to mimic catalog find using metadata archive
>   client: catalog shell: fallback to accessor for navigation
> 
>  pbs-client/src/catalog_shell.rs      | 291 +++++++++++++++++++++------
>  pbs-client/src/pxar/extract.rs       |   2 +-
>  pbs-client/src/pxar/mod.rs           |   4 +-
>  pbs-client/src/pxar/tools.rs         | 256 ++++++++++++++++++++++-
>  pbs-client/src/tools/mod.rs          | 120 -----------
>  pbs-datastore/src/catalog.rs         |  40 ++++
>  proxmox-backup-client/src/catalog.rs |  65 +++++-
>  proxmox-file-restore/src/main.rs     |  38 +---
>  pxar-bin/src/main.rs                 |   4 +-
>  src/api2/admin/datastore.rs          |   2 +-
>  src/api2/tape/restore.rs             |   2 +-
>  11 files changed, 599 insertions(+), 225 deletions(-)
> 

Looks OK to me in general code wise, albeit I did not evaluate every
patch very closely, but considering that a spot check did not find
anything odd and this is all mostly internal and got already reviewed
by Fabian I'd be fine with applying it.

That said, your S-o-b trailer seems to be missing from all patches.
For the refactoring ones it might be also nice to have a short sentence
for why this is done, e.g. referencing the future use like "this will
be used to do XYZ in a future commit".




More information about the pbs-devel mailing list