[pbs-devel] [PATCH backup] verify: print number of chunks failing verification

Wolfgang Bumiller w.bumiller at proxmox.com
Tue Apr 15 13:32:00 CEST 2025


On Mon, Apr 14, 2025 at 10:28:45AM +0200, Maximiliano Sandoval wrote:
> We also re-use the error_count variable defined right above.
> 
> Signed-off-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
> ---
>  src/backup/verify.rs | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/backup/verify.rs b/src/backup/verify.rs
> index 3d2cba8ac..1344b3b22 100644
> --- a/src/backup/verify.rs
> +++ b/src/backup/verify.rs
> @@ -231,8 +231,8 @@ fn verify_index_chunks(
>          "  verified {read_bytes_mib:.2}/{decoded_bytes_mib:.2} MiB in {elapsed:.2} seconds, speed {read_speed:.2}/{decode_speed:.2} MiB/s ({error_count} errors)"
>      );
>  
> -    if errors.load(Ordering::SeqCst) > 0 {
> -        bail!("chunks could not be verified");
> +    if error_count > 0 {
> +        bail!("{error_count} chunks could not be verified");

The message could also be interpreted as "we couldn't perform the
verification for arbitrary reasons", rather than "this many chunks are
broken". That's a bit odd.

Also, I'm not convinced the number is accurate.
The `decoder_pool` seems to count a case where the encryption mode is
not the expected one in *addition* to failed verifications.

If we want to count the actual chunks, we'd need an additional variable
whose name should also reflect that it is meant to count failed chunks,
not generic errors.

>      }
>  
>      Ok(())
> -- 
> 2.39.5




More information about the pbs-devel mailing list