Skip to content

Commit

Permalink
Merge pull request #2628 from subspace/recoverable-piece-scrub
Browse files Browse the repository at this point in the history
Make piece reading during `scrub` recoverable
  • Loading branch information
nazar-pc authored Mar 19, 2024
2 parents b8e8fc4 + bd1229d commit 284b10c
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions crates/subspace-farmer/src/single_disk_farm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1931,12 +1931,8 @@ impl SingleDiskFarm {
%offset,
"Failed to read piece bytes"
);
return Err(SingleDiskFarmScrubError::FailedToReadBytes {
file: plot_file_path.clone(),
size: piece.len() as u64,
offset,
error,
});

continue;
}

hasher.update(piece.as_ref());
Expand All @@ -1949,12 +1945,13 @@ impl SingleDiskFarm {
+ u64::from(pieces_in_sector) * Piece::SIZE as u64;
if let Err(error) = plot_file.read_exact_at(&mut expected_checksum, offset)
{
return Err(SingleDiskFarmScrubError::FailedToReadBytes {
file: plot_file_path.clone(),
size: expected_checksum.len() as u64,
offset,
error,
});
warn!(
path = %plot_file_path.display(),
%error,
%sector_index,
%offset,
"Failed to read checksum bytes"
);
}
}

Expand Down

0 comments on commit 284b10c

Please sign in to comment.