[pbs-devel] [PATCH proxmox-backup v5 1/4] partial fix #6049: config: enable config version cache for datastore

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Nov 26 16:15:53 CET 2025


nit for the subject: this doesn't yet partially fix anything..

On November 24, 2025 6:04 pm, Samuel Rufinatscha wrote:
> Repeated /status requests caused lookup_datastore() to re-read and
> parse datastore.cfg on every call. The issue was mentioned in report
> #6049 [1]. cargo-flamegraph [2] confirmed that the hot path is
> dominated by pbs_config::datastore::config() (config parsing).
> 
> To solve the issue, this patch prepares the config version cache,
> so that datastore config caching can be built on top of it.
> This patch specifically:
> (1) implements increment function in order to invalidate generations
> (2) removes obsolete comments
> 
> Links
> 
> [1] Bugzilla: https://bugzilla.proxmox.com/show_bug.cgi?id=6049
> [2] cargo-flamegraph: https://github.com/flamegraph-rs/flamegraph
> 
> Fixes: #6049
> Signed-off-by: Samuel Rufinatscha <s.rufinatscha at proxmox.com>

Reviewed-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>

> ---
> Changes:
> 
> From v1 → v2 (original introduction), thanks @Fabian
> - Split the ConfigVersionCache changes out of the large datastore patch
> into their own config-only patch
>     * removed the obsolete // FIXME comment on datastore_generation
>     * added ConfigVersionCache::datastore_generation() as getter
> 
> From v2 → v3
> No changes
> 
> From v3 → v4
> No changes
> 
> From v4 → v5
> - Rebased only, no changes
> 
>  pbs-config/src/config_version_cache.rs | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/pbs-config/src/config_version_cache.rs b/pbs-config/src/config_version_cache.rs
> index e8fb994f..b875f7e0 100644
> --- a/pbs-config/src/config_version_cache.rs
> +++ b/pbs-config/src/config_version_cache.rs
> @@ -26,7 +26,6 @@ struct ConfigVersionCacheDataInner {
>      // Traffic control (traffic-control.cfg) generation/version.
>      traffic_control_generation: AtomicUsize,
>      // datastore (datastore.cfg) generation/version
> -    // FIXME: remove with PBS 3.0
>      datastore_generation: AtomicUsize,
>      // Add further atomics here
>  }
> @@ -145,8 +144,15 @@ impl ConfigVersionCache {
>              .fetch_add(1, Ordering::AcqRel);
>      }
>  
> +    /// Returns the datastore generation number.
> +    pub fn datastore_generation(&self) -> usize {
> +        self.shmem
> +            .data()
> +            .datastore_generation
> +            .load(Ordering::Acquire)
> +    }
> +
>      /// Increase the datastore generation number.
> -    // FIXME: remove with PBS 3.0 or make actually useful again in datastore lookup
>      pub fn increase_datastore_generation(&self) -> usize {
>          self.shmem
>              .data()
> -- 
> 2.47.3
> 
> 
> 
> _______________________________________________
> pbs-devel mailing list
> pbs-devel at lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
> 




More information about the pbs-devel mailing list