public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dietmar Maurer <dietmar@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	Dominik Csapak <d.csapak@proxmox.com>
Subject: [pbs-devel] applied: [PATCH proxmox-backup] api2: tape/restore: commit temporary catalog at the end
Date: Wed, 28 Jul 2021 11:29:37 +0200	[thread overview]
Message-ID: <2439dcf3-cf0c-4069-6191-c934c35f00b1@proxmox.com> (raw)
In-Reply-To: <20210720085511.1767928-1-d.csapak@proxmox.com>

applied

On 7/20/21 10:55 AM, Dominik Csapak wrote:
> in 'restore_archive', we reach that 'catalog.commit()' for
> * every skipped snapshot (we already call 'commit_if_large' then before)
> * every skipped chunk archive (no change in catalog since we do not read
>    the chunk archive in that case)
> * after reading a catalog (no change in catalog)
>
> in all other cases, we call 'commit_if_large' and return early,
> meaning that the 'commit' there was executed too often and
> unnecessary, so move it after the loop over the files, before
> finishing the temporary database.
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> this should reduce the number of commits quite a bit, and make my
> previous series[0] work ok
>
> 0: https://lists.proxmox.com/pipermail/pbs-devel/2021-July/003711.html
>
>   src/api2/tape/restore.rs | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/api2/tape/restore.rs b/src/api2/tape/restore.rs
> index f959a856..8a8e8a36 100644
> --- a/src/api2/tape/restore.rs
> +++ b/src/api2/tape/restore.rs
> @@ -998,6 +998,8 @@ pub fn restore_media(
>           restore_archive(worker.clone(), reader, current_file_number, target, &mut catalog, checked_chunks_map, verbose)?;
>       }
>   
> +    catalog.commit()?;
> +
>       MediaCatalog::finish_temporary_database(status_path, &media_id.label.uuid, true)?;
>   
>       Ok(())
> @@ -1153,8 +1155,6 @@ fn restore_archive<'a>(
>            _ =>  bail!("unknown content magic {:?}", header.content_magic),
>       }
>   
> -    catalog.commit()?;
> -
>       Ok(())
>   }
>   




      reply	other threads:[~2021-07-28  9:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-20  8:55 [pbs-devel] " Dominik Csapak
2021-07-28  9:29 ` Dietmar Maurer [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=2439dcf3-cf0c-4069-6191-c934c35f00b1@proxmox.com \
    --to=dietmar@proxmox.com \
    --cc=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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal