From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 2A55B1FF13F for ; Wed, 14 Jan 2026 11:45:13 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6066CF70F; Wed, 14 Jan 2026 11:45:09 +0100 (CET) Date: Wed, 14 Jan 2026 11:44:30 +0100 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox Backup Server development discussion References: <20260102160750.285157-1-s.rufinatscha@proxmox.com> <20260102160750.285157-2-s.rufinatscha@proxmox.com> In-Reply-To: <20260102160750.285157-2-s.rufinatscha@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.17.0 (https://github.com/astroidmail/astroid) Message-Id: <1768385119.5iiludao6t.astroid@yuna.none> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1768387427961 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.104 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_1 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com] Subject: Re: [pbs-devel] [PATCH proxmox-backup v3 1/4] pbs-config: add token.shadow generation to ConfigVersionCache X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" On January 2, 2026 5:07 pm, Samuel Rufinatscha wrote: > Currently, every token-based API request reads the token.shadow file and > runs the expensive password hash verification for the given token > secret. This shows up as a hotspot in /status profiling (see > bug #7017 [1]). > > To solve the issue, this patch prepares the config version cache, > so that token_shadow_generation config caching can be built on > top of it. > > This patch specifically: > (1) implements increment function in order to invalidate generations this is needlessly verbose.. > > This patch is part of the series which fixes bug #7017 [1]. this is already mentioned higher up and doesn't need to be repeated here. this patch needs a rebase. it would be good to call out why it is safe to add to this struct, since it is accessed/mapped by both old and new processes. > > [1] https://bugzilla.proxmox.com/show_bug.cgi?id=7017 > > Signed-off-by: Samuel Rufinatscha > --- > pbs-config/src/config_version_cache.rs | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/pbs-config/src/config_version_cache.rs b/pbs-config/src/config_version_cache.rs > index e8fb994f..1376b11d 100644 > --- a/pbs-config/src/config_version_cache.rs > +++ b/pbs-config/src/config_version_cache.rs > @@ -28,6 +28,8 @@ struct ConfigVersionCacheDataInner { > // datastore (datastore.cfg) generation/version > // FIXME: remove with PBS 3.0 > datastore_generation: AtomicUsize, > + // Token shadow (token.shadow) generation/version. > + token_shadow_generation: AtomicUsize, > // Add further atomics here > } > > @@ -153,4 +155,20 @@ impl ConfigVersionCache { > .datastore_generation > .fetch_add(1, Ordering::AcqRel) > } > + > + /// Returns the token shadow generation number. > + pub fn token_shadow_generation(&self) -> usize { > + self.shmem > + .data() > + .token_shadow_generation > + .load(Ordering::Acquire) > + } > + > + /// Increase the token shadow generation number. > + pub fn increase_token_shadow_generation(&self) -> usize { > + self.shmem > + .data() > + .token_shadow_generation > + .fetch_add(1, Ordering::AcqRel) > + } > } > -- > 2.47.3 > > > > _______________________________________________ > 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