synology_apm_repo.sdk.dedup.verify_walk module¶
ReachabilitySweep: the dedup half of units.verify_reachable’s
reachability-scoped integrity check. Given the composition extents a
version’s content lives in, it checks each composition header and record
once per run, claims every bucket the extents’ chunk maps touch, then
checks each claimed bucket once, whole, through
dedup.verify_bucket_check (in a process pool at FULL when the store
can be reopened in a worker).
A bucket shared by several versions tags its findings (Finding.ref)
with the version that claimed it first.
- class synology_apm_repo.sdk.dedup.verify_walk.CompositionExtent(dedup_file, start, end, unit_label)¶
Bases:
objectOne composition record’s byte range a
Version’s content lives in —[start, end)withindedup_file. An FS or SaaS version has exactly one of these, a VM version one per disk, and a PC/PS version one per disk fragment.
- class synology_apm_repo.sdk.dedup.verify_walk.ReachabilitySweep(repo, level, *, progress=None, executor=None, tuning=None)¶
Bases:
objectPer-run state for one repository’s sweep. Owns a private
Pool(fingerprint and ciphertext-CRC verification forced on) and opens each bucket uncached, so the sweep doesn’t thrash the repository’s shared bucket caches; the composition records it walks do go through the shared composition-record cache.claim_extentclaims buckets;check_all_bucketschecks them as a separate pass once every extent is claimed (finalize_pending_bucketsfirst).- async claim_extent(extent, ref, label)¶
Check
extent’s composition header and record once per run, then claim (not check) every bucket its chunk map touches for the versionref/labelnames, unless an earlier version already did. Returns only composition-stage findings.
- async finalize_pending_buckets()¶
Move every pending claimed bucket into
_buckets_to_check. Called after every batch of claims (units.verify_reachable) and once discovery finishes.At FULL, also sizes each bucket for
_total_bytes_to_verify(FULL progress is in bytes). QUICK’s per-bucket cost doesn’t scale with size, so its progress counts buckets and it skips sizing.
- async check_all_buckets()¶
Check every bucket
finalize_pending_buckets()has queued, once discovery is complete.At FULL with a store a worker process can reopen (a
PoolDescriptor), buckets are checked in a process pool for multi-core decoding; otherwise in-process,VerifyTuning.max_concurrent_readsat a time (at FULL, no more thanmax_concurrent_decodes). Progress ticks once per bucket.