From: Jakob Cornell Date: Sat, 9 Apr 2022 21:30:42 +0000 (-0400) Subject: Verify tool: process v1 sectors in disk order X-Git-Url: https://jcornell.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=66bc36ab428e79cb736814b9e9a690a6a03b8d38;p=eros.git Verify tool: process v1 sectors in disk order --- diff --git a/disk_jumble/src/disk_jumble/db.py b/disk_jumble/src/disk_jumble/db.py index 278d12d..4a82eba 100644 --- a/disk_jumble/src/disk_jumble/db.py +++ b/disk_jumble/src/disk_jumble/db.py @@ -107,7 +107,7 @@ class Wrapper: ) and (incomplete_edge.end_off - slab.entity_offset) %% %(sector_size)s = 0 where disk_id = %(disk_id)s - order by slab.entity_id, entity_offset, slab_id + order by disk_blocks ; """ with self.conn.cursor() as cursor: diff --git a/disk_jumble/src/disk_jumble/verify.py b/disk_jumble/src/disk_jumble/verify.py index 2f61e3c..759876f 100644 --- a/disk_jumble/src/disk_jumble/verify.py +++ b/disk_jumble/src/disk_jumble/verify.py @@ -44,7 +44,7 @@ class _BadSector(Exception): pass -def do_verify(conn, disk_id: int, sector_size: int, disk_file: io.BufferedIOBase, read_size: int, read_tries: int) -> None: +def do_verify_v1(conn, disk_id: int, sector_size: int, disk_file: io.BufferedIOBase, read_size: int, read_tries: int) -> None: db = DbWrapper(conn) tasks = [] @@ -274,7 +274,7 @@ def _gen_verify_results(conn, disk_id: int, disk_file: io.BufferedIOBase, read_s slab_plus.entity_id = elh.entity_id and slab_plus.entity_blocks && elh.block_range ) - left outer join public.entity on elh.entity_id=entity.entity_id + left outer join public.entity on elh.entity_id = entity.entity_id ) where slab_plus.disk_id = %(disk_id)s order by sector @@ -382,5 +382,5 @@ if __name__ == "__main__": conn.autocommit = True path = f"/dev/mapper/diskjumble-{args.disk_id}" with open(path, "rb", buffering = _READ_BUFFER_SIZE) as disk_file: - do_verify(conn, args.disk_id, SECTOR_SIZE, disk_file, _READ_BUFFER_SIZE, args.read_tries) + do_verify_v1(conn, args.disk_id, SECTOR_SIZE, disk_file, _READ_BUFFER_SIZE, args.read_tries) do_verify_v2(conn, args.disk_id, disk_file, _READ_BUFFER_SIZE, args.read_tries)