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
@@ -14,6 +14,10 @@ import (
|
||||
"git.zb-server.de/Sebi/CephfsMig/internal/storage"
|
||||
)
|
||||
|
||||
// errSkipSubtree, returned by a walkNative visitor for a directory, skips
|
||||
// the entries below it.
|
||||
var errSkipSubtree = errors.New("skip subtree")
|
||||
|
||||
func walkNative(ctx context.Context, fs storage.FS, root string, visit func(string, storage.Node, int) error) error {
|
||||
var walk func(string, storage.Node, int) error
|
||||
walk = func(p string, n storage.Node, depth int) error {
|
||||
@@ -25,7 +29,9 @@ func walkNative(ctx context.Context, fs storage.FS, root string, visit func(stri
|
||||
return errors.New("native directory depth exceeds 128")
|
||||
}
|
||||
|
||||
if err := visit(p, n, depth); err != nil {
|
||||
if err := visit(p, n, depth); errors.Is(err, errSkipSubtree) && n.Kind() == storage.Directory {
|
||||
return nil
|
||||
} else if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user