From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH guest-common 3/4] rely only on storeid_list from replication state on full removal
Date: Thu, 1 Oct 2020 13:15:34 +0200 [thread overview]
Message-ID: <20201001111535.13721-3-f.ebner@proxmox.com> (raw)
In-Reply-To: <20201001111535.13721-1-f.ebner@proxmox.com>
Using the information from the replication state alone should be more correct.
E.g. the configuration might contain a new, not yet replicated volume when the
full removal happens, causing unneeded scanning on the target node.
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
Could be squashed with the previous patch.
There could be an edge case where the information from
the config might be useful: namely if the replication state is
missing/corrupt and full removal happens immediately without
normal replication happening in between. But IMHO it's not worth
keeping the extra code just for that...
PVE/Replication.pm | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/PVE/Replication.pm b/PVE/Replication.pm
index 15845bb..60cfc67 100644
--- a/PVE/Replication.pm
+++ b/PVE/Replication.pm
@@ -243,15 +243,8 @@ sub replicate {
$logfunc->("start job removal - mode '${remove_job}'");
if ($remove_job eq 'full' && $jobcfg->{target} ne $local_node) {
- # remove all remote volumes
- my @store_list = map { (PVE::Storage::parse_volume_id($_))[0] } @$sorted_volids;
- push @store_list, @{$state->{storeid_list}};
-
- my %hash = map { $_ => 1 } @store_list;
-
my $ssh_info = PVE::SSHInfo::get_ssh_info($jobcfg->{target});
- remote_prepare_local_job($ssh_info, $jobid, $vmid, [], [ keys %hash ], 1, undef, 1, $logfunc);
-
+ remote_prepare_local_job($ssh_info, $jobid, $vmid, [], $state->{storeid_list}, 1, undef, 1, $logfunc);
}
# remove all local replication snapshots (lastsync => 0)
prepare($storecfg, $sorted_volids, $jobid, 1, undef, $logfunc);
--
2.20.1
next prev parent reply other threads:[~2020-10-01 11:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-01 11:15 [pve-devel] [PATCH manager 1/4] remove all stale replicated volumes Fabian Ebner
2020-10-01 11:15 ` [pve-devel] [PATCH guest-common 2/4] also consider storages from replication state on full removal Fabian Ebner
2020-10-01 11:15 ` Fabian Ebner [this message]
2020-10-01 11:15 ` [pve-devel] [PATCH guest-common 4/4] cleanup storeid_list creation Fabian Ebner
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=20201001111535.13721-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.