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 v2] datastore: fix problem with operations counting
Date: Tue, 02 Jul 2024 17:06:52 +0200 [thread overview]
Message-ID: <1719932806.kba80dcc5z.astroid@yuna.none> (raw)
In-Reply-To: <20240425090150.63500-1-h.laimer@proxmox.com>
On April 25, 2024 11:01 am, Hannes Laimer wrote:
> ... if `.chunks/` is not available(deleted/moved) ChunkStore::open
> fails, but that would happen after updating the active operations on the
> datastore, so no reference that could be dropped is returned. Leading to
> the operations counter to always increase. This only updates the counter
> when a reference is returned, not before.
>
> Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
> ---
> pbs-datastore/src/datastore.rs | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs
> index f95da761..5e2208bc 100644
> --- a/pbs-datastore/src/datastore.rs
> +++ b/pbs-datastore/src/datastore.rs
> @@ -158,13 +158,6 @@ impl DataStore {
> }
> }
>
> - if let Some(operation) = operation {
> - update_active_operations(name, operation, 1)?;
> - }
> -
> - // Our operation is registered, unlock the config.
> - drop(config_lock);
> -
> let mut datastore_cache = DATASTORE_MAP.lock().unwrap();
> let entry = datastore_cache.get(name);
>
> @@ -172,6 +165,9 @@ impl DataStore {
> let chunk_store = if let Some(datastore) = &entry {
> let last_digest = datastore.last_digest.as_ref();
> if let Some(true) = last_digest.map(|last_digest| last_digest == &digest) {
> + if let Some(operation) = operation {
> + update_active_operations(name, operation, 1)?;
> + }
> return Ok(Arc::new(Self {
> inner: Arc::clone(datastore),
> operation,
> @@ -195,6 +191,10 @@ impl DataStore {
> let datastore = Arc::new(datastore);
> datastore_cache.insert(name.to_string(), datastore.clone());
>
> + if let Some(operation) = operation {
> + update_active_operations(name, operation, 1)?;
> + }
> +
> Ok(Arc::new(Self {
> inner: datastore,
> operation,
> --
> 2.39.2
>
>
>
> _______________________________________________
> 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
prev parent reply other threads:[~2024-07-02 15:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-25 9:01 [pbs-devel] " Hannes Laimer
2024-07-02 15:06 ` 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=1719932806.kba80dcc5z.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