fix: dont send if start == end
This commit is contained in:
+8
-1
@@ -66,6 +66,8 @@ class Manager:
|
|||||||
stream = self._send_absolute(local_dataset)
|
stream = self._send_absolute(local_dataset)
|
||||||
else:
|
else:
|
||||||
stream = self._send_incremental(local_dataset, remote_dataset)
|
stream = self._send_incremental(local_dataset, remote_dataset)
|
||||||
|
if stream is None:
|
||||||
|
continue
|
||||||
ZFS.receive(stream, self._external_pool)
|
ZFS.receive(stream, self._external_pool)
|
||||||
|
|
||||||
def _get_user_filtered_dataset_backup_map(self) -> _map_type:
|
def _get_user_filtered_dataset_backup_map(self) -> _map_type:
|
||||||
@@ -97,12 +99,14 @@ class Manager:
|
|||||||
|
|
||||||
def _send_incremental(
|
def _send_incremental(
|
||||||
self, local_dataset: Dataset, remote_dataset: Dataset
|
self, local_dataset: Dataset, remote_dataset: Dataset
|
||||||
) -> Popen:
|
) -> Popen | None:
|
||||||
"""Send incremental stream between two datasets to remote."""
|
"""Send incremental stream between two datasets to remote."""
|
||||||
start_snapshot = self._get_newest_common_snapshot_with_backup_tags(
|
start_snapshot = self._get_newest_common_snapshot_with_backup_tags(
|
||||||
local_dataset, remote_dataset
|
local_dataset, remote_dataset
|
||||||
)
|
)
|
||||||
end_snapshot = self._get_newest_snapshot_with_backup_tag(local_dataset)
|
end_snapshot = self._get_newest_snapshot_with_backup_tag(local_dataset)
|
||||||
|
if start_snapshot == end_snapshot:
|
||||||
|
return None
|
||||||
stream = ZFS.send_incremental(start_snapshot, end_snapshot)
|
stream = ZFS.send_incremental(start_snapshot, end_snapshot)
|
||||||
return stream
|
return stream
|
||||||
|
|
||||||
@@ -742,6 +746,9 @@ class Snapshot:
|
|||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return str(self._path)
|
return str(self._path)
|
||||||
|
|
||||||
|
def __eq__(self, other: ZFSPath):
|
||||||
|
return self._path == other._path
|
||||||
|
|
||||||
def newer_than(self, other: Snapshot) -> bool:
|
def newer_than(self, other: Snapshot) -> bool:
|
||||||
return self > other
|
return self > other
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user