public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup] sync: switch reader back to a shared lock
@ 2025-04-16  8:56 Shannon Sterz
  2025-04-16  9:37 ` [pbs-devel] applied: " Fabian Grünbichler
  0 siblings, 1 reply; 2+ messages in thread
From: Shannon Sterz @ 2025-04-16  8:56 UTC (permalink / raw)
  To: pbs-devel

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pbs-devel] applied: [PATCH proxmox-backup] sync: switch reader back to a shared lock
  2025-04-16  8:56 [pbs-devel] [PATCH proxmox-backup] sync: switch reader back to a shared lock Shannon Sterz
@ 2025-04-16  9:37 ` Fabian Grünbichler
  0 siblings, 0 replies; 2+ messages in thread
From: Fabian Grünbichler @ 2025-04-16  9:37 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-04-16  9:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-16  8:56 [pbs-devel] [PATCH proxmox-backup] sync: switch reader back to a shared lock Shannon Sterz
2025-04-16  9:37 ` [pbs-devel] applied: " Fabian Grünbichler

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