From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 1/3] backup/datastore: count still bad chunks for the status
Date: Fri, 23 Oct 2020 16:32:31 +0200 [thread overview]
Message-ID: <20201023143233.14949-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20201023143233.14949-1-d.csapak@proxmox.com>
we want to show the user that there are still bad chunks after a garbage
collection
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/api2/types/mod.rs | 3 +++
src/backup/chunk_store.rs | 2 ++
2 files changed, 5 insertions(+)
diff --git a/src/api2/types/mod.rs b/src/api2/types/mod.rs
index f97db557..1b9a305f 100644
--- a/src/api2/types/mod.rs
+++ b/src/api2/types/mod.rs
@@ -587,6 +587,8 @@ pub struct GarbageCollectionStatus {
pub pending_chunks: usize,
/// Number of chunks marked as .bad by verify that have been removed by GC.
pub removed_bad: usize,
+ /// Number of chunks still marked as .bad after garbage collection.
+ pub still_bad: usize,
}
impl Default for GarbageCollectionStatus {
@@ -602,6 +604,7 @@ impl Default for GarbageCollectionStatus {
pending_bytes: 0,
pending_chunks: 0,
removed_bad: 0,
+ still_bad: 0,
}
}
}
diff --git a/src/backup/chunk_store.rs b/src/backup/chunk_store.rs
index 96c46efb..b7556f8a 100644
--- a/src/backup/chunk_store.rs
+++ b/src/backup/chunk_store.rs
@@ -354,9 +354,11 @@ impl ChunkStore {
},
Err(nix::Error::Sys(nix::errno::Errno::ENOENT)) => {
// chunk hasn't been rewritten yet, keep .bad file
+ status.still_bad += 1;
},
Err(err) => {
// some other error, warn user and keep .bad file around too
+ status.still_bad += 1;
crate::task_warn!(
worker,
"error during stat on '{:?}' - {}",
--
2.20.1
next prev parent reply other threads:[~2020-10-23 14:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-23 14:32 [pbs-devel] [PATCH proxmox-backup 0/3] improve and extend admin/datastore/status api Dominik Csapak
2020-10-23 14:32 ` Dominik Csapak [this message]
2020-10-23 14:32 ` [pbs-devel] [PATCH proxmox-backup 2/3] backup/datastore: save garbage collection status to disk Dominik Csapak
2020-10-23 14:32 ` [pbs-devel] [PATCH proxmox-backup 3/3] admin/datastore: add more info to status call Dominik Csapak
2020-11-03 5:52 ` Dietmar Maurer
2020-11-03 6:53 ` Dominik Csapak
2020-10-27 16:44 ` [pbs-devel] applied-series: [PATCH proxmox-backup 0/3] improve and extend admin/datastore/status api Thomas Lamprecht
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=20201023143233.14949-2-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