Skip to main content

metadata_markers

Markers on metadata bookkeeping rows, and the reads that honour them.

A file_metadata pass that found nothing changed, a scan_metadata run that skipped because its inventory was not current, and either runtime giving up on a busy metadata lock all close their rows complete. Their stop_reason tag (STOP_REASON_TAG) lets the readers that compare an index with the scan that followed it pass over them: a no-change index left the inventory as the last walk made it, and a skipped scan read nothing.

An index row closed as METADATA_BUSY also carries none of the input tags (file_metadata_run_tags), so the readers that measure a full pass by its inputs (refresh staleness, the walk baseline, inventory_is_current) never match it.

A full file_metadata pass that walked the tree also records whether it found anything changed (INVENTORY_CHANGED_TAG), which the next pass reads to decide whether probing the tree for changes first is worth it.

Module​

Functions​

last_index_walk_at​

def last_index_walk_at(cache: CacheProtocol, task_hash: str) ‑> datetime | None:

Return when the last completed index pass that walked the tree finished.

Arguments

  • cache: The pod's background cache.
  • task_hash: The datasource-level task hash.

last_scan_sweep_at​

def last_scan_sweep_at(cache: CacheProtocol, task_hash: str) ‑> datetime | None:

Return when the last completed scan that read its inventory finished.

Arguments

  • cache: The pod's background cache.
  • task_hash: The datasource-level task hash.

Global variables​

  • INDEX_SKIP_TAGS - Tags of an index row closed without walking the tree.
  • INVENTORY_CHANGED_TAG - Bookkeeping-row tag of a full index pass that walked the tree: whether it wrote or relocated a row, or found a file missing. Absent from a pass that did not walk.
  • INVENTORY_NOT_CURRENT - stop_reason of a scan that skipped because its inventory was not current.
  • INVENTORY_UNCHANGED - stop_reason of an index pass that found nothing changed and did not walk.
  • METADATA_BUSY - stop_reason of a run that gave up waiting for its metadata lock.
  • SCAN_SKIP_TAGS - Tags of a scan row closed without reading its inventory.
  • STOP_REASON_TAG - Bookkeeping-row tag holding a run's stop_reason.