if bookmark creation fails use guid bases suffix based fallback name
This commit is contained in:
parent
99b439e383
commit
a748b41f09
14
syncoid
14
syncoid
|
@ -688,10 +688,24 @@ sub syncdataset {
|
||||||
$bookmarkcmd = "$sourcesudocmd $zfscmd bookmark $sourcefsescaped\@$newsyncsnapescaped $sourcefsescaped\#$newsyncsnapescaped";
|
$bookmarkcmd = "$sourcesudocmd $zfscmd bookmark $sourcefsescaped\@$newsyncsnapescaped $sourcefsescaped\#$newsyncsnapescaped";
|
||||||
}
|
}
|
||||||
if ($debug) { print "DEBUG: $bookmarkcmd\n"; }
|
if ($debug) { print "DEBUG: $bookmarkcmd\n"; }
|
||||||
|
system($bookmarkcmd) == 0 or do {
|
||||||
|
# fallback: assume nameing conflict and try again with guid based suffix
|
||||||
|
my $guid = $snaps{'source'}{$newsyncsnap}{'guid'};
|
||||||
|
$guid = substr($guid, 0, 6);
|
||||||
|
|
||||||
|
if (!$quiet) { print "INFO: bookmark creation failed, retrying with guid based suffix ($guid)...\n"; }
|
||||||
|
|
||||||
|
if ($sourcehost ne '') {
|
||||||
|
$bookmarkcmd = "$sshcmd $sourcehost " . escapeshellparam("$sourcesudocmd $zfscmd bookmark $sourcefsescaped\@$newsyncsnapescaped $sourcefsescaped\#$newsyncsnapescaped$guid");
|
||||||
|
} else {
|
||||||
|
$bookmarkcmd = "$sourcesudocmd $zfscmd bookmark $sourcefsescaped\@$newsyncsnapescaped $sourcefsescaped\#$newsyncsnapescaped$guid";
|
||||||
|
}
|
||||||
|
if ($debug) { print "DEBUG: $bookmarkcmd\n"; }
|
||||||
system($bookmarkcmd) == 0 or do {
|
system($bookmarkcmd) == 0 or do {
|
||||||
warn "CRITICAL ERROR: $bookmarkcmd failed: $?";
|
warn "CRITICAL ERROR: $bookmarkcmd failed: $?";
|
||||||
if ($exitcode < 2) { $exitcode = 2; }
|
if ($exitcode < 2) { $exitcode = 2; }
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue