marsadm: fix join-cluster missing dirs

This commit is contained in:
Thomas Schoebel-Theuer 2020-10-15 10:22:39 +02:00 committed by Thomas Schoebel-Theuer
parent c9b7fcf7f9
commit d3acf3f9c8
1 changed files with 3 additions and 2 deletions

View File

@ -3590,6 +3590,9 @@ sub join_cluster {
my $old_uuid = get_link("$mars/uuid", 2);
if (!$old_uuid || $old_uuid eq "(any)") {
mkdir("$mars/ips") unless -d "$mars/ips";
mkdir("$mars/todo-global") unless -d "$mars/todo-global";
mkdir("$mars/defaults-$host") unless -d "$mars/defaults-$host";
mkdir("$mars/actual-$host") unless -d "$mars/actual-$host";
set_link("(any)", "$mars/uuid") unless $old_uuid;
set_link($ip, "$mars/ips/ip-$host");
set_link($peer_ip, "$mars/ips/ip-$peer");
@ -3603,8 +3606,6 @@ sub join_cluster {
my $new_uuid = get_link("$mars/uuid");
if ($new_uuid && $new_uuid ne "(any)") {
lprint "Successfully joined cluster, uuid='$new_uuid'\n";
mkdir("$mars/defaults-$host") unless -d "$mars/defaults-$host";
mkdir("$mars/actual-$host") unless -d "$mars/actual-$host";
# write again, this time with current mars_time()
set_link($ip, "$mars/ips/ip-$host");
set_link("0", "$mars/defaults-$host/sync-limit");