public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup] garbage_collection: only ignore 'missing chunk' errors
Date: Mon,  1 Feb 2021 09:07:12 +0100	[thread overview]
Message-ID: <20210201080712.28074-1-d.csapak@proxmox.com> (raw)

with the fix for #2909 (improving handling missing chunks), we
changed from bailing to warning during a garbage collection when
updating the atime of a chunk.

but, updating the atime can not only fail when the chunk is missing,
but also on other occasions, e.g. no permissions or more importantly,
no space left on the device. in that case, the atime of a valid and used
chunk cannot be updated, and the second sweep of the gc will remove that chunk.
[0] is a real world example of that happening.

instead, only warn on really missin chunks, and bail on all other
errors.

0: https://forum.proxmox.com/threads/pbs-server-full-two-days-later-almost-empty.83274/

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
this can easily be tested by marking a chunk immutable with 'chattr +i <chunk>'
before that patch, the worker will warn and going over to the second phase,
with this patch, we will abort the gc

 src/backup/datastore.rs | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/backup/datastore.rs b/src/backup/datastore.rs
index fae7ff25..f8298ae8 100644
--- a/src/backup/datastore.rs
+++ b/src/backup/datastore.rs
@@ -445,13 +445,12 @@ impl DataStore {
             worker.check_abort()?;
             tools::fail_on_shutdown()?;
             let digest = index.index_digest(pos).unwrap();
-            if let Err(err) = self.chunk_store.touch_chunk(digest) {
+            if !self.chunk_store.cond_touch_chunk(digest, false)? {
                 crate::task_warn!(
                     worker,
-                    "warning: unable to access chunk {}, required by {:?} - {}",
+                    "warning: unable to access non-existant chunk {}, required by {:?}",
                     proxmox::tools::digest_to_hex(digest),
                     file_name,
-                    err,
                 );
 
                 // touch any corresponding .bad files to keep them around, meaning if a chunk is
-- 
2.20.1





             reply	other threads:[~2021-02-01  8:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01  8:07 Dominik Csapak [this message]
2021-02-01  8:18 ` Dietmar Maurer

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=20210201080712.28074-1-d.csapak@proxmox.com \
    --to=d.csapak@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