feat(native): skip unchanged subtrees in intermediate sync rounds
Intermediate cephmig round snapshots skip a subdirectory whose inode, inode version and ceph.dir.rctime equal those in the base snapshot. The index carries the subtree's entries over from the base and marks them carried; carried entries never serve as base for a block delta. Snapdiff, copy, pruning and verification leave skipped subtrees out. Application snapshots and finalize always scan everything, so a change missed because of delayed rctime propagation or a lagging client clock costs extra work but cannot reach the final state. The config option full_scan disables the shortcut; the journal reports skipped_subtrees. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b7d2a0687e
commit
83e15bccb2
9 files changed
+394
-12
No files matched your search
@@ -574,6 +574,7 @@ func (e Engine) Sync(ctx context.Context, c Config, statePath string, final bool
|
||||
func sameMigrationIdentity(a, b Config) bool {
|
||||
a.Workers, b.Workers = 0, 0
|
||||
a.BandwidthKiB, b.BandwidthKiB = 0, 0
|
||||
a.FullScan, b.FullScan = false, false
|
||||
return reflect.DeepEqual(a, b)
|
||||
}
|
||||
|
||||
@@ -622,7 +623,10 @@ func (e Engine) transfer(ctx context.Context, src, dst ceph, target, statePath s
|
||||
aware, isNative := e.Transport.(RoundTransport)
|
||||
existed := slices.Contains(targetNames, snap.Name)
|
||||
if isNative {
|
||||
round := Round{SourcePath: from, TargetPath: target, Name: snap.Name, StatePath: statePath, BaseName: s.LiveSnapshot}
|
||||
// Only intermediate round snapshots may skip unchanged subtrees. They are
|
||||
// deleted later, and finalize scans everything again.
|
||||
round := Round{SourcePath: from, TargetPath: target, Name: snap.Name, StatePath: statePath, BaseName: s.LiveSnapshot,
|
||||
SkipUnchanged: snap.Owned && !snap.Final && !s.Config.FullScan}
|
||||
if s.LiveSnapshot != "" {
|
||||
round.BaseSourcePath, err = src.snapshotPath(ctx, s.LiveSnapshot)
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user