public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>
Subject: [pbs-devel] applied: [PATCH proxmox-backup] sync: switch reader back to a shared lock
Date: Wed, 16 Apr 2025 11:37:18 +0200	[thread overview]
Message-ID: <1744796145.vk4lkz8o6r.astroid@yuna.none> (raw)
In-Reply-To: <20250416085644.41749-1-s.sterz@proxmox.com>

On April 16, 2025 10:56 am, Shannon Sterz wrote:
> the below commit accidentally switched this lock to an exclusive lock
> when it should just be a shared one as that is sufficient for a
> reader:
> 
> e2c1866b: datastore/api/backup: prepare for fix of #3935 by adding
> lock helpers
> 
> this has already caused failed backups for a user with a sync job that
> runs while they are trying to create a new backup.
> 
> https://forum.proxmox.com/threads/165038
> Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
> ---
> 
> this also explains the issue we have seen on an internal pbs host.
> 
>  src/server/sync.rs | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/server/sync.rs b/src/server/sync.rs
> index 528e2054..09814ef0 100644
> --- a/src/server/sync.rs
> +++ b/src/server/sync.rs
> @@ -480,7 +480,7 @@ impl SyncSource for LocalSource {
>      ) -> Result<Arc<dyn SyncSourceReader>, Error> {
>          let dir = self.store.backup_dir(ns.clone(), dir.clone())?;
>          let guard = dir
> -            .lock()
> +            .lock_shared()
>              .with_context(|| format!("while reading snapshot '{dir:?}' for a sync job"))?;
>          Ok(Arc::new(LocalSourceReader {
>              _dir_lock: Arc::new(Mutex::new(guard)),
> --
> 2.39.5
> 
> 
> 
> _______________________________________________
> pbs-devel mailing list
> pbs-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
> 
> 
> 


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


      reply	other threads:[~2025-04-16  9:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-16  8:56 [pbs-devel] " Shannon Sterz
2025-04-16  9:37 ` Fabian Grünbichler [this message]

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=1744796145.vk4lkz8o6r.astroid@yuna.none \
    --to=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