From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH rrd-migration-tool 2/2] migrate nodes: fix handling nonexistent nodes
Date: Fri, 1 Aug 2025 15:54:29 +0200 [thread overview]
Message-ID: <20250801135443.133089-3-f.ebner@proxmox.com> (raw)
In-Reply-To: <20250801135443.133089-1-f.ebner@proxmox.com>
Use the same expression as in the OK(()) branch after the
do_rrd_migration() call. Previously, the presence of a nonexistent
node would lead to a failure:
> Error migrating nodes: Not a directory (os error 20)
That is because the path would have a duplicate node name attached,
for example:
> /var/lib/rrdcached/db/pve2-node/nonexistent/nonexistent
Fixing that alone is not enough, there also was a 'continue' missing
to avoid calling do_rrd_migration() with the old node, i.e. to
actually skip it.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/main.rs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main.rs b/src/main.rs
index fb58d3a..9afd48b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -528,10 +528,11 @@ fn migrate_nodes(
if !resource_present(format!("{resources}/.members").as_str(), node.as_str())? {
if migrate {
println!("Node: '{node}' not present. Skip and mark as old.");
- mv_old(format!("{}/{node}", file.0.to_string_lossy()).as_str())?;
+ mv_old(full_path.as_str())?;
} else {
println!("Node: '{node}' not present. Would mark as old, but in dry-run mode, so just skip.");
}
+ continue;
}
match do_rrd_migration(
file,
--
2.47.2
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-08-01 13:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-01 13:54 [pve-devel] [PATCH-SERIES rrd-migration-tool 0/2] " Fiona Ebner
2025-08-01 13:54 ` [pve-devel] [PATCH rrd-migration-tool 1/2] d/control: record librust-pretty-assertions-dev build dependency Fiona Ebner
2025-08-01 13:54 ` Fiona Ebner [this message]
2025-08-01 14:52 ` [pve-devel] applied: [PATCH-SERIES rrd-migration-tool 0/2] migrate nodes: fix handling nonexistent nodes Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250801135443.133089-3-f.ebner@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.