Skip to content

Update Repair Code to use the Directory Heap

Matthew Sevey requested to merge 3491-add-from-dirheap into master

MERGE REQUEST

Changes to Work Flow

This MR replaces the use of managedWorstHealthDirectory with popping a directory off the directory heap. Since the directory heap starts with an unexplored root directory being added, directories will be popped of the heap until an explored directory is found. When an unexplored directory is found, unexplored directory elements for all the subdirectories are added, then the directory is marked as explored and added back to the heap.

The directory heap was updated to prioritize explored directories. This will cause the repair code to work through the file system top to bottom but still following the path of lowest health. One edge case that is handled better by prioritizing explored directories is the case of a healthy file system. In that case the heap will pop off an unexplored root, go through the process of exploring it, and then pop off the explored root and return it. If unexplored directories were prioritized, the heap would have to explore all directories down to the lowest level that had the lowest health before returning a directory and finding that the file system is healthy. Additionally if unexplored directories were prioritized, to avoid that unnecessary directory exploration we would need to add a manual check versus being able to just rely on the heap.

The directory heap is reset when the repair loop starts up again after sleeping due to the file system being healthy.

Testing Updates

N/A

Modules and Packages Impacted

  • modules/renter

Working on #3491 (closed)

Edited by Matthew Sevey

Merge request reports