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
@@ -94,7 +94,9 @@ func (b *nativeTransport) copyRegular(ctx context.Context, job nativeJob) error
|
||||
|
||||
if changed {
|
||||
usedBlockDiff := false
|
||||
if trusted && job.node.Size >= nativeBlockThreshold {
|
||||
// A carried entry describes an older round than the base snapshot, so
|
||||
// a block delta against the base could miss changes.
|
||||
if trusted && !previous.Carried && job.node.Size >= nativeBlockThreshold {
|
||||
old, err := b.source.Stat(path.Join(b.round.BaseSourcePath, job.rel))
|
||||
if err == nil && old.Kind() == storage.Regular && old.Inode == job.node.Inode {
|
||||
stream, err := b.source.BlockDiff(b.snapRoot, path.Join(b.snapRel, job.rel), b.round.BaseName, b.round.Name)
|
||||
@@ -377,6 +379,10 @@ func (b *nativeTransport) Verify(ctx context.Context, from, to string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if n.Kind() == storage.Directory {
|
||||
return b.skipped(rel)
|
||||
}
|
||||
|
||||
if n.Kind() != storage.Directory {
|
||||
if n.Nlink > 1 {
|
||||
same, err := index.observe("source", nodeKey(n.Inode), nodeKey(target.Inode))
|
||||
@@ -492,7 +498,7 @@ func (b *nativeTransport) verifyInventory(ctx context.Context, to string) error
|
||||
return fmt.Errorf("unexpected native target entry %s", rel)
|
||||
}
|
||||
|
||||
return nil
|
||||
return b.skipped(rel)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user