fix zfs send for expired snapshots
This commit is contained in:
parent
3b1d0fc850
commit
2ca0695a1f
19
box.go
19
box.go
@ -198,13 +198,18 @@ func TransferDirectZfs(from, to Addr) error {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fromFromSnapshotId := -1
|
fromFromSnapshotId := len(fromSnapshots)
|
||||||
lastToSnapshot := toSnapshots[len(toSnapshots)-1]
|
fromToSnapshotId := -1
|
||||||
log.WithFields(log.Fields{"from": from, "to": to}).Debugf("searching last snapshot %s", lastToSnapshot.String())
|
for fromFromSnapshotId >= 0 {
|
||||||
for id, v := range fromSnapshots {
|
fromFromSnapshotId = fromFromSnapshotId - 1
|
||||||
if v.name == lastToSnapshot.name {
|
fromToSnapshotId = len(toSnapshots)
|
||||||
fromFromSnapshotId = id
|
for fromToSnapshotId >= 0 {
|
||||||
log.WithFields(log.Fields{"from": from, "to": to}).Debugf("found %s", v.String())
|
fromToSnapshotId = fromToSnapshotId - 1
|
||||||
|
if fromSnapshots[fromFromSnapshotId].name == toSnapshots[fromToSnapshotId].name {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if fromToSnapshotId >= 0 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by version.sh (@generated) DO NOT EDIT.
|
// Code generated by version.sh (@generated) DO NOT EDIT.
|
||||||
package main
|
package main
|
||||||
var githash = "e7ed6cb"
|
var githash = "3b1d0fc"
|
||||||
var branch = "master"
|
var branch = "master"
|
||||||
var buildstamp = "2023-08-22_11:08:53"
|
var buildstamp = "2023-09-10_16:35:29"
|
||||||
var commits = "85"
|
var commits = "86"
|
||||||
var version = "e7ed6cb-b85 - 2023-08-22_11:08:53"
|
var version = "3b1d0fc-b86 - 2023-09-10_16:35:29"
|
||||||
|
3
zfs.go
3
zfs.go
@ -311,6 +311,9 @@ func (fs *ZfsFs) AddSnapshot(s *ZfsSnapshot) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (fs *ZfsFs) ValidSnapshots() []*ZfsSnapshot {
|
func (fs *ZfsFs) ValidSnapshots() []*ZfsSnapshot {
|
||||||
|
log.WithFields(log.Fields{"box": fs.zfs.box.name, "fs": fs.path}).Debugf("starting")
|
||||||
|
defer log.WithFields(log.Fields{"box": fs.zfs.box.name, "fs": fs.path}).Debugf("done")
|
||||||
|
|
||||||
tab := make([]*ZfsSnapshot, 0)
|
tab := make([]*ZfsSnapshot, 0)
|
||||||
|
|
||||||
for _, s := range fs.snapshots {
|
for _, s := range fs.snapshots {
|
||||||
|
Loading…
Reference in New Issue
Block a user