public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>,
	"Christian Ebner" <c.ebner@proxmox.com>,
	"Proxmox Backup Server development discussion"
	<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup] GC: s3: fix local marker cleanup for unreferenced, s3 only chunks
Date: Mon, 24 Nov 2025 10:00:25 +0100	[thread overview]
Message-ID: <bccbc898-80e2-42d3-a76f-ec3db7c1cf19@proxmox.com> (raw)
In-Reply-To: <1763972888.fq1bwvzgnc.astroid@yuna.none>

Am 24.11.25 um 09:29 schrieb Fabian Grünbichler:
> On November 24, 2025 9:22 am, Christian Ebner wrote:
>> On 11/24/25 9:13 AM, Fabian Grünbichler wrote:
>>> we basically already have such a boolean marker - we set `atime` to 0 in
>>> this case (and only this case), and we could just ignore the removal
>>> errors then? possibly limited to just ignoring ENOTFOUND?
>>
>> That's a good idea! So I will perform the additional checks based on that.
> 
> alternatively, skipping cond_sweep_chunk entirely would also work (this
> is with `-w`):
> 
> diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs
> index 65299cca9..b9debd2b1 100644
> --- a/pbs-datastore/src/datastore.rs
> +++ b/pbs-datastore/src/datastore.rs
> @@ -1709,21 +1709,22 @@ impl DataStore {
>                      // Check local markers (created or atime updated during phase1) and
>                      // keep or delete chunk based on that.
>                      let atime = match std::fs::metadata(&chunk_path) {
> -                        Ok(stat) => stat.accessed()?,
> +                        Ok(stat) => Some(stat.accessed()?),
>                          Err(err) if err.kind() == std::io::ErrorKind::NotFound => {
>                              if self.inner.chunk_store.clear_chunk_expected_mark(&digest)? {
>                                  unsafe {
>                                      // chunk store lock held
>                                      self.inner.chunk_store.replace_chunk_with_marker(&digest)?;
>                                  }
> -                                SystemTime::now()
> +                                Some(SystemTime::now())
>                              } else {
> -                                // File not found, delete by setting atime to unix epoch
> -                                SystemTime::UNIX_EPOCH
> +                                // File not found, only delete from S3
> +                                None
>                              }
>                          }
>                          Err(err) => return Err(err.into()),
>                      };
> +                    if let Some(atime) = atime {
>                          let atime = atime.duration_since(SystemTime::UNIX_EPOCH)?.as_secs() as i64;
>  
>                          unsafe {
> @@ -1752,6 +1753,13 @@ impl DataStore {
>                                  },
>                              )?;
>                          }
> +                    } else {
> +                        // set age based on first insertion
> +                        if delete_list.is_empty() {
> +                            delete_list_age = epoch_i64();
> +                        }
> +                        delete_list.push((content.key, _chunk_guard));
> +                    }


This is easier to understand for me change-wise and looks OK to me (no in-depth review
though).




_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel

  parent reply	other threads:[~2025-11-24  9:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-22 10:41 Christian Ebner
2025-11-22 14:56 ` Thomas Lamprecht
2025-11-24  7:35   ` Christian Ebner
2025-11-24  8:13     ` Fabian Grünbichler
2025-11-24  8:22       ` Christian Ebner
2025-11-24  8:29         ` Fabian Grünbichler
2025-11-24  8:34           ` Christian Ebner
2025-11-24  9:00           ` Thomas Lamprecht [this message]
2025-11-24  9:41 ` Christian Ebner

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=bccbc898-80e2-42d3-a76f-ec3db7c1cf19@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=c.ebner@proxmox.com \
    --cc=f.gruenbichler@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