From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id C402C1FF17A for ; Fri, 18 Jul 2025 10:27:38 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id BACF71678C; Fri, 18 Jul 2025 10:28:46 +0200 (CEST) Message-ID: <79cca18b-c722-48b7-8840-3b5d63870e6e@proxmox.com> Date: Fri, 18 Jul 2025 10:28:13 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Proxmox Backup Server development discussion , Christian Ebner References: <20250715125332.954494-1-c.ebner@proxmox.com> <20250715125332.954494-22-c.ebner@proxmox.com> Content-Language: de-AT, en-US From: Lukas Wagner In-Reply-To: <20250715125332.954494-22-c.ebner@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1752827291220 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.020 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 SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pbs-devel] [PATCH proxmox-backup v8 12/45] api: datastore: conditionally upload client log to s3 backend 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" Reviewed-by: Lukas Wagner On 2025-07-15 14:52, Christian Ebner wrote: > If the datastore is backed by an s3 compatible object store, upload > the client log content to the s3 backend before persisting it to the > local cache store. > > Signed-off-by: Christian Ebner > --- > changes since version 7: > - no changes > > src/api2/admin/datastore.rs | 11 +++++++++++ > 1 file changed, 11 insertions(+) > > diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs > index 02666afda..b28b646e8 100644 > --- a/src/api2/admin/datastore.rs > +++ b/src/api2/admin/datastore.rs > @@ -1637,6 +1637,17 @@ pub fn upload_backup_log( > // always verify blob/CRC at server side > let blob = DataBlob::load_from_reader(&mut &data[..])?; > > + if let DatastoreBackend::S3(s3_client) = datastore.backend()? { > + let object_key = pbs_datastore::s3::object_key_from_path( > + &backup_dir.relative_path(), > + file_name.as_ref(), > + ) > + .context("invalid client log object key")?; > + let data = hyper::body::Bytes::copy_from_slice(blob.raw_data()); > + proxmox_async::runtime::block_on(s3_client.upload_with_retry(object_key, data, true)) > + .context("failed to upload client log to s3 backend")?; > + }; > + > replace_file(&path, blob.raw_data(), CreateOptions::new(), false)?; > > // fixme: use correct formatter -- - Lukas _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel