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: object

One composition record’s byte range a Version’s content lives in — [start, end) within dedup_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.

dedup_file: DedupFile
start: int
end: int
unit_label: str

For a Finding.path — e.g. "VM disk 'disk1.vmdk'", "PC/PS disk fragment fid=42".

class synology_apm_repo.sdk.dedup.verify_walk.ReachabilitySweep(repo, level, *, progress=None, executor=None, tuning=None)

Bases: object

Per-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_extent claims buckets; check_all_buckets checks them as a separate pass once every extent is claimed (finalize_pending_buckets first).

property pending_bucket_count: int
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 version ref/label names, 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_reads at a time (at FULL, no more than max_concurrent_decodes). Progress ticks once per bucket.