swh.scrubber.storage_checker module#

Reads all objects in a swh-storage instance and recomputes their checksums.

swh.scrubber.storage_checker.postgresql_storage_db(storage)[source]#
swh.scrubber.storage_checker.get_datastore(storage) Datastore[source]#
class swh.scrubber.storage_checker.StorageChecker(db: ScrubberDb, config_id: int, storage: StorageInterface, limit: int = 0)[source]#

Bases: object

Reads a chunk of a swh-storage database, recomputes checksums, and reports errors in a separate database.

property config: ConfigEntry#
property nb_partitions: int#
property object_type: str#
property datastore: Datastore#

Returns a Datastore instance representing the swh-storage instance being checked.

property statsd: Statsd#
run() None[source]#

Runs on all objects of object_type in a partition between start_partition_id (inclusive) and end_partition_id (exclusive)

check_object_hashes(objects: Iterable[Union[Revision, Release, Snapshot, Directory, Content]])[source]#

Recomputes hashes, and reports mismatches.

check_object_references(objects: Iterable[Union[Revision, Release, Snapshot, Directory, Content]])[source]#

Check all objects references by these objects exist.