public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] applied: [PATCH backup] backup verify: re-check if we can skip a chunk in the actual verify loop
Date: Thu, 15 Apr 2021 10:13:22 +0200	[thread overview]
Message-ID: <20210415081322.32556-1-t.lamprecht@proxmox.com> (raw)

Fixes a non-negligible performance regression from commit
7f394c807bca3f451e77b6a1cf7de7c6e7df5f92

While we skip known-verified chunks in the stat-and-inode-sort loop,
those are only the ones from previous indexes. If there's a repeated
chunk in one index they would get re-verified more often as required.

So, add the check again explicitly to the read+verify loop.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
---
 src/backup/verify.rs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/backup/verify.rs b/src/backup/verify.rs
index ed959813..1192821e 100644
--- a/src/backup/verify.rs
+++ b/src/backup/verify.rs
@@ -214,6 +214,12 @@ fn verify_index_chunks(
 
         let info = index.chunk_info(pos).unwrap();
 
+        // we must always recheck this here, the parallel worker below alter it!
+        // Else we miss skipping repeated chunks from the same index, and re-verify them all
+        if verify_worker.verified_chunks.lock().unwrap().contains(&info.digest) {
+            continue; // already verified
+        }
+
         match verify_worker.datastore.load_chunk(&info.digest) {
             Err(err) => {
                 verify_worker.corrupt_chunks.lock().unwrap().insert(info.digest);
-- 
2.29.2





                 reply	other threads:[~2021-04-15  8:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210415081322.32556-1-t.lamprecht@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal