mirror of https://github.com/jimsalterjrs/sanoid
Compare commits
5 Commits
cd8534a5c5
...
eab257db1f
| Author | SHA1 | Date |
|---|---|---|
|
|
eab257db1f | |
|
|
1ae8f26e82 | |
|
|
d9fe50b564 | |
|
|
d8ff385691 | |
|
|
89d3cbcda3 |
6
sanoid
6
sanoid
|
|
@ -1380,9 +1380,9 @@ sub check_zpool() {
|
|||
# check for io/checksum errors
|
||||
|
||||
my @vdeverr = ();
|
||||
if ($read != 0) { push @vdeverr, "read" };
|
||||
if ($write != 0) { push @vdeverr, "write" };
|
||||
if ($cksum != 0) { push @vdeverr, "cksum" };
|
||||
if ($read ne 0) { push @vdeverr, "read" };
|
||||
if ($write ne 0) { push @vdeverr, "write" };
|
||||
if ($cksum ne 0) { push @vdeverr, "cksum" };
|
||||
|
||||
if (scalar @vdeverr) {
|
||||
$dmge=$dmge . "(" . $dev . ":" . join(", ", @vdeverr) . " errors) ";
|
||||
|
|
|
|||
21
syncoid
21
syncoid
|
|
@ -431,7 +431,7 @@ sub syncdataset {
|
|||
if (!defined $args{'no-sync-snap'} && !defined $skipsnapshot) {
|
||||
# create a new syncoid snapshot on the source filesystem.
|
||||
$newsyncsnap = newsyncsnap($sourcehost,$sourcefs,$sourceisroot);
|
||||
if (!$newsyncsnap) {
|
||||
if ($newsyncsnap eq '') {
|
||||
# we already whined about the error
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -439,7 +439,7 @@ sub syncdataset {
|
|||
# --include-snaps
|
||||
if (!snapisincluded($newsyncsnap)) {
|
||||
$newsyncsnap = getnewestsnapshot($sourcehost,$sourcefs,$sourceisroot);
|
||||
if ($newsyncsnap eq 0) {
|
||||
if ($newsyncsnap eq '') {
|
||||
writelog('WARN', "CRITICAL: no snapshots exist on source $sourcefs, and you asked for --no-sync-snap.");
|
||||
if ($exitcode < 1) { $exitcode = 1; }
|
||||
return 0;
|
||||
|
|
@ -448,7 +448,7 @@ sub syncdataset {
|
|||
} else {
|
||||
# we don't want sync snapshots created, so use the newest snapshot we can find.
|
||||
$newsyncsnap = getnewestsnapshot($sourcehost,$sourcefs,$sourceisroot);
|
||||
if ($newsyncsnap eq 0) {
|
||||
if ($newsyncsnap eq '') {
|
||||
writelog('WARN', "CRITICAL: no snapshots exist on source $sourcefs, and you asked for --no-sync-snap.");
|
||||
if ($exitcode < 1) { $exitcode = 1; }
|
||||
return 0;
|
||||
|
|
@ -476,13 +476,13 @@ sub syncdataset {
|
|||
writelog('DEBUG', "target $targetfs does not exist, and --no-stream selected. Finding newest available snapshot on source $sourcefs ...");
|
||||
}
|
||||
my $oldestsnap = getoldestsnapshot(\%snaps);
|
||||
if (! $oldestsnap) {
|
||||
if ($oldestsnap eq '') {
|
||||
if (defined ($args{'no-sync-snap'}) ) {
|
||||
# we already whined about the missing snapshots
|
||||
return 0;
|
||||
}
|
||||
|
||||
# getoldestsnapshot() returned false, so use new sync snapshot
|
||||
# getoldestsnapshot() returned null, so use new sync snapshot
|
||||
writelog('DEBUG', "getoldestsnapshot() returned false, so using $newsyncsnap.");
|
||||
$oldestsnap = $newsyncsnap;
|
||||
}
|
||||
|
|
@ -726,11 +726,8 @@ sub syncdataset {
|
|||
|
||||
# do a normal replication if bookmarks aren't used or if previous
|
||||
# bookmark replication was only done to the next oldest snapshot
|
||||
if (!$bookmark || $nextsnapshot) {
|
||||
if ($matchingsnap eq $newsyncsnap) {
|
||||
# edge case: bookmark replication used the latest snapshot
|
||||
return 0;
|
||||
}
|
||||
# edge case: skip repilcation if bookmark replication used the latest snapshot
|
||||
if ((!$bookmark || $nextsnapshot) && !($matchingsnap eq $newsyncsnap)) {
|
||||
|
||||
($exit, $stdout) = syncincremental($sourcehost, $sourcefs, $targethost, $targetfs, $matchingsnap, $newsyncsnap, defined($args{'no-stream'}));
|
||||
|
||||
|
|
@ -1541,7 +1538,7 @@ sub getoldestsnapshot {
|
|||
# well, actually we set --no-sync-snap, so no we *didn't* already make one. Whoops.
|
||||
writelog('CRITICAL', "--no-sync-snap is set, and getoldestsnapshot() could not find any snapshots on source!");
|
||||
}
|
||||
return 0;
|
||||
return '';
|
||||
}
|
||||
|
||||
sub getnewestsnapshot {
|
||||
|
|
@ -1563,7 +1560,7 @@ sub getnewestsnapshot {
|
|||
writelog('WARN', "--no-sync-snap is set, and getnewestsnapshot() could not find any snapshots on source for current dataset. Continuing.");
|
||||
if ($exitcode < 2) { $exitcode = 2; }
|
||||
}
|
||||
return 0;
|
||||
return '';
|
||||
}
|
||||
|
||||
sub buildsynccmd {
|
||||
|
|
|
|||
Loading…
Reference in New Issue