httk.store.mongo.fsck

Integrity repair and mark/sweep collection for httk.store.mongo.

Classes

FsckCollectionSummary

Counters collected for one record or dispatch collection.

FsckSummary

The immutable result of one fsck() run.

Functions

run_fsck(store, *[, repair, collect_garbage, ...])

Run the exclusive MongoStore integrity repair and garbage collector.

Module Contents

class httk.store.mongo.fsck.FsckCollectionSummary[source]

Counters collected for one record or dispatch collection.

Parameters:
  • examined – Documents inspected in the collection.

  • repaired – Documents inserted or removed by integrity repair.

  • conflicts – Integrity violations found in the collection.

  • deleted – Documents removed, including conflict removals and swept dependencies.

examined: int = 0[source]
repaired: int = 0[source]
conflicts: int = 0[source]
deleted: int = 0[source]
class httk.store.mongo.fsck.FsckSummary[source]

The immutable result of one fsck() run.

Parameters:
  • generation – Metadata generation after this run’s single increment.

  • collections – Per-collection repair and collection counters.

  • violations – Human-readable violations reported during the run.

generation: int[source]
collections: collections.abc.Mapping[str, FsckCollectionSummary][source]
violations: tuple[str, Ellipsis][source]
httk.store.mongo.fsck.run_fsck(store, *, repair=True, collect_garbage=True, repair_conflicts=False, force=False, known_types=())[source]

Run the exclusive MongoStore integrity repair and garbage collector.

Parameters:
  • store (httk.store.mongo.store.MongoStore) – The owning MongoStore instance.

  • repair (bool) – Whether missing main-role dispatch entries are repaired.

  • collect_garbage (bool) – Whether unmarked dependency documents are swept.

  • repair_conflicts (bool) – Whether invalid dispatch documents are deleted.

  • force (bool) – Administrative override passed to the fsck lease protocol.

  • known_types (tuple[type, Ellipsis]) – Record classes needed to attribute ordinary collections after reopening a store.

Returns:

Immutable per-collection counters and all reported violations.

Return type:

FsckSummary