From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 2DE2CD5EE for ; Thu, 1 Dec 2022 11:51:16 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1551B27E32 for ; Thu, 1 Dec 2022 11:51:16 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Thu, 1 Dec 2022 11:51:15 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 4481A44331 for ; Thu, 1 Dec 2022 11:51:14 +0100 (CET) Message-ID: Date: Thu, 1 Dec 2022 11:51:12 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Content-Language: en-US To: Proxmox Backup Server development discussion , Stefan Hanreich References: <20221130150102.242374-1-s.hanreich@proxmox.com> From: Lukas Wagner In-Reply-To: <20221130150102.242374-1-s.hanreich@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.120 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.257 Looks like a legit reply (A) 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. [pull.rs, datastore.rs, jobs.rs, sync.rs, prune.rs, proxmox-backup-manager.rs] Subject: Re: [pbs-devel] [PATCH proxmox-backup v2 0/7] Add Prune Options to Sync Jobs 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: , X-List-Received-Date: Thu, 01 Dec 2022 10:51:16 -0000 Hi, gave this test series a quick test on the latest master. Set up a second PBS and set up a sync job with enabled pruning. Only tested "keep-last" prune option due to practical reasons. In further testing I made sure that the group filters also apply to the pruning operation. Everything seems to work as expected. Also looked through the code, which looks good to me. In summary, consider this Tested-by: Lukas Wagner Reviewed-by: Lukas Wagner On 11/30/22 16:00, Stefan Hanreich wrote: > This relies on my small formatting fix in the email > [PATCH proxmox-backup 1/1] Fix formatting in proxmox-backup-manager > otherwise it will have a merge conflict. > > This patch adds the possibility of configuring prune options for sync jobs. This > runs a prune job after a successful sync job that prunes the backup groups that > got synced by the respective sync job (meaning this respects group-filter, > max-depth, target namespace and so on). > > The prune options can also be specified when running a single pull command. > > I also added the possibility of configuring this via the Web UI in the same way > as configuring a regular prune job. > > The new options are documented in the Sync Job documentation as well. > > This patch series introduces a new struct, PruneJob, that encapsulates the > pruning functionality in its own struct that can be conveniently used. This > greatly reduces the code duplication between the sites that used pruning > functionality. > > Changes from v2: > - Refactored pull function by extracting remove_vanished and prune into > their own methods > - Added PruneJob struct that encapsulates PruneJob functionality > - Refactored existing call sites to utilize new PruneJob struct > - Use KeepOptions::default where applicable > - minor formatting and cargo clippy fixes > > Stefan Hanreich (7): > Add KeepOptions parameters to pull & sync-job > refactor prune.rs - add PruneJob struct for handling prune jobs > Add pruning parameters to the pull command > use new PruneJob in prune command > use new PruneJob struct in Prune Jobs implementation > add KeepOptions to Web UI of Sync Jobs > Add documentation for prune options in Sync Jobs > > docs/managing-remotes.rst | 14 ++ > pbs-api-types/src/jobs.rs | 7 +- > pbs-datastore/src/prune.rs | 279 ++++++++++++++++++------------ > src/api2/admin/datastore.rs | 71 ++++---- > src/api2/config/sync.rs | 52 ++++++ > src/api2/pull.rs | 17 +- > src/bin/proxmox-backup-manager.rs | 17 +- > src/server/prune_job.rs | 29 +--- > src/server/pull.rs | 173 ++++++++++++------ > tests/prune.rs | 4 +- > www/window/SyncJobEdit.js | 5 + > 11 files changed, 433 insertions(+), 235 deletions(-) > -- Best Regards, Lukas Wagner