Verify: remove memory hog audit
authorJakob Cornell <jakob+gpg@jcornell.net>
Fri, 22 Apr 2022 06:18:26 +0000 (01:18 -0500)
committerJakob Cornell <jakob+gpg@jcornell.net>
Fri, 22 Apr 2022 06:18:26 +0000 (01:18 -0500)
disk_jumble/src/disk_jumble/verify.py

index 4cd7939b5aa0f701ffb4417bffd6e54f5e721838..db1bcdcbcf5c12d44032865cedb635e6585494b2 100644 (file)
@@ -1,7 +1,6 @@
 from __future__ import annotations
 from dataclasses import dataclass
 from typing import Iterator, List, Optional
-from warnings import warn
 import argparse
 import contextlib
 import hashlib
@@ -277,11 +276,6 @@ def _get_v2_worklist(conn, disk_id: int, target_ranges: List[NumericRange]) -> I
 
 
 def _do_verify(conn, disk_id: int, target_ranges: List[range], disk_file: io.BufferedIOBase, read_size: int, read_tries: int):
-       requested_blocks = {
-               block
-               for r in target_ranges
-               for block in r
-       }
        pg_target_ranges = [NumericRange(r.start, r.stop) for r in target_ranges]
 
        # transaction is required for named cursors in worklist generation
@@ -292,7 +286,6 @@ def _do_verify(conn, disk_id: int, target_ranges: List[range], disk_file: io.Buf
                        key = _run_sort_key,
                )
 
-               covered_blocks = set()
                passes = []
                fails = []
                for run in worklist:
@@ -333,16 +326,6 @@ def _do_verify(conn, disk_id: int, target_ranges: List[range], disk_file: io.Buf
                                else:
                                        fails.extend(run.block_ranges)
 
-                       covered_blocks.update(
-                               block
-                               for block_range in run.block_ranges
-                               for block in block_range
-                       )
-
-       missing = requested_blocks - covered_blocks
-       if missing:
-               warn(f"unable to locate blocks: {len(missing)} in the range {min(missing)} to {max(missing)}")
-
        def clean_up(ranges):
                out = []
                for r in sorted(ranges, key = lambda r: r.start):