From f8d64c6cc6536acecc0d7bfdc8e56ab5791ca1b0 Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Wed, 6 Feb 2019 14:18:56 +0100 Subject: [PATCH] marsadm: fix superfluous peer set --- userspace/marsadm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/userspace/marsadm b/userspace/marsadm index eedaa596..4cff2090 100755 --- a/userspace/marsadm +++ b/userspace/marsadm @@ -763,6 +763,15 @@ sub get_alive_links { # peer must be participating in the same resources my @other = glob("$mars/resource-$res/data-$peer"); next unless @other; + # I must be participating in some of the _same_ resources + my $common = 0; + foreach my $check (@other) { + my $self = `dirname $check`; + chomp $self; + $self .= "/data-$host"; + $common++ if -e $self; + } + next unless $common; # OK: remember peer $peers{$peer} = 1; }