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 949231FF137 for ; Tue, 17 Mar 2026 14:47:34 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 53EA4EFE7; Tue, 17 Mar 2026 14:47:47 +0100 (CET) Message-ID: <47cc7466-ec85-4a32-99d7-d8dedf7fadf5@proxmox.com> Date: Tue, 17 Mar 2026 14:47:43 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH proxmox-backup v4 0/7] fixes #6195: add support for moving groups and namespaces To: Hannes Laimer , pbs-devel@lists.proxmox.com References: <20260311151315.133637-1-h.laimer@proxmox.com> Content-Language: en-US, de-DE From: Christian Ebner In-Reply-To: <20260311151315.133637-1-h.laimer@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1773755222912 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.059 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 Message-ID-Hash: NM7VDQS5BV6FOIP4GI5FZYUKP7DWDDNP X-Message-ID-Hash: NM7VDQS5BV6FOIP4GI5FZYUKP7DWDDNP 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 3/11/26 4:12 PM, Hannes Laimer wrote: > Implements moving both backup groups and namespaces within a datastore. > This also adds namespace locking, this allows moves to happen within a > datastore that is otherwise in-use. > > > # Namespace locking > > To make move_group and move_namespace safe against concurrent > operations, a namespace-level locking scheme is introduced in the first > patch. > > Lock files live at: > /run/proxmox-backup/locks///.ns-lock > > Two lock modes are used, both non-blocking (timeout=0): > > - Shared: held by operations that read from or write into a namespace > (backup, pull/push sync, verify per snapshot, prune per group). > Acquiring a shared lock on ns also acquires shared locks on all > non-root ancestors, so an exclusive lock on any ancestor blocks > all active operations below it. > > - Exclusive: held by operations that structurally modify a namespace > (move_namespace, move_group on the group lock). > Acquiring an exclusive lock on ns also acquires shared locks on all > non-root ancestors, mirroring the shared variant so that two > concurrent structural operations on related namespaces contend > correctly. > > Locking up the ancestor chain rather than down the subtree keeps the > cost O(depth), bounded by MAX_NAMESPACE_DEPTH (8). > > Verify and prune skip gracefully when a namespace lock cannot be > acquired, since a concurrent move is a transient condition. > create_locked_backup_group now returns (owner, ns_guard, group_guard), > all callers updated. > > # Moving > > ## Groups > 1. lock source ns (shared), lock target ns (shared), lock group (exclusive) > 2. create target type directory > 3. FS: rename group directory > S3: copy objects, rename cache, delete source objects > > ## Namespace > 1. lock source ns (exclusive), lock target ns (exclusive) > 2. FS: rename namespace directory > S3: - create target ns dirs and markers, both on S3 and local cache > - move groups one by one, if copying fails the group stays at > the source and can be moved afterwards manually > - clean up empty source ns dirs Finally managed to do some testing (as promised( today. Major things tested: - Moving of namespaces on regular and S3 backed datastores - Namespaces cannot be moved to themself - Groups cannot be moved to namespace already containing same group - Renamed namespaces by move to same parent with different name - Checked namespace/group cannot move while ongoing backup - Moving externally flocked namespace/group is not possible, including shared lock on parents Did not run into issues. What I did lack tough is an easy way to move namespaces/groups via the CLI. Other than that this is in a pretty good shape already!