From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id A6BFF1FF0C0 for ; Wed, 18 Nov 2026 16:19:23 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id AA39F216E3; Wed, 18 Nov 2026 16:19:22 +0100 (CET) Message-ID: Date: Wed, 18 Nov 2026 16:19:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH proxmox-backup 05/12] tape: backup job: allow selecting groups by snapshot attributes To: Samuel Rufinatscha , Jakob-Tobias Winter , pbs-devel@lists.proxmox.com References: <20261113085637.57360-3-tobias@stuttgart.de> <20261113085637.57360-8-tobias@stuttgart.de> <0ab4a114-3946-4855-842f-9a6dfb5ae1bf@proxmox.com> Content-Language: en-US, de-DE From: Christian Ebner In-Reply-To: <0ab4a114-3946-4855-842f-9a6dfb5ae1bf@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795015156076 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.365 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: XRN5RG7HZCPKBFNCQJN6AZYMTDZPBEKW X-Message-ID-Hash: XRN5RG7HZCPKBFNCQJN6AZYMTDZPBEKW X-MailFrom: c.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 11/18/26 2:07 PM, Samuel Rufinatscha wrote: > On 11/13/26 10:06 AM, Jakob-Tobias Winter wrote: >> Tape backup jobs can only select backup groups by type and ID so >> far. Such filters have to be kept up to date by hand for every new >> guest, and an ID says nothing about how important a guest is. >> >> Add an attribute filter to tape backup jobs. With a client which >> stores the tags of a guest as snapshot attributes, production and >> test guests can be written to different media pools with different >> retention policies, by using one job for each media pool. The media >> sets of the production guests then need fewer tapes and are faster >> to restore. >> >> A group is included if it has one of the attributes given as include >> filter, or if there are no include filters, and none of the >> attributes given as exclude filter. The filter is applied in >> addition to the group filter. >> >> Jobs without an attribute filter select the same groups as before. >> >> Signed-off-by: Jakob-Tobias Winter >> --- >> A version without this patch cannot parse a tape-job.cfg in which the >> new option is used (unknown property 'attribute-filter'). >> >>   src/api2/config/tape_backup_job.rs |  8 ++++++++ >>   src/api2/tape/backup.rs            | 19 ++++++++++++++++--- >>   src/bin/proxmox-tape.rs            | 11 ++++++++--- >>   3 files changed, 32 insertions(+), 6 deletions(-) >> >> diff --git a/src/api2/config/tape_backup_job.rs b/src/api2/config/ >> tape_backup_job.rs >> index 4bfc7f871..cb9e63ea6 100644 >> --- a/src/api2/config/tape_backup_job.rs >> +++ b/src/api2/config/tape_backup_job.rs [..] >> @@ -391,6 +391,19 @@ fn backup_worker( >>           None => group_list, >>       }; >> +    let group_list = match &setup.attribute_filter { >> +        Some(filters) => { >> +            let mut filtered = Vec::new(); >> +            for group in group_list { >> +                if AttributeFilter::apply_filters(filters, >> &group.attributes()?) { > > once we filter for individual snapshots as suggested by @Christian, > how should latest-only behave? > > For example, if monday and tuesday are tagged with "test" and wednesday > is tagged with "prod", should a test job copy the tuesday snapshot or > skip the group because the latest backup in the group is on "prod"? I lean towards handling this similar to verified-/encrypted-only is handled in sync jobs, where transfer-last is only applied after filtering [0]. That attribute filters are applied before cutoff via latest-only must then be documented explicitly. > I would lean towards copying tuesday’s snapshot in this example since > it’s the newest one and it matches the job’s filter [0] https://git.proxmox.com/?p=proxmox-backup.git;a=blob;f=src/server/pull.rs;h=763fdb5d3bf873d68281ceca5f2e9abab385e196;hb=HEAD#l1204