fix(storage): fix critical bug in range calculation (#2493)

Signed-off-by: Mohamed Zenadi <zeapo@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Mohamed Zenadi
2026-04-11 18:20:15 +02:00
committed by GitHub
parent 11552eb722
commit c8c71e34b6
2 changed files with 102 additions and 3 deletions
+4 -2
View File
@@ -419,6 +419,7 @@ async fn build_reconstructed_part_stream(
skip_verify_bitrot: bool,
use_zero_copy: bool,
) -> Result<Option<BoxChunkStream>> {
let shard_length = till_offset.saturating_sub(read_offset);
let mut readers = Vec::with_capacity(disks.len());
let mut errors = Vec::with_capacity(disks.len());
for (idx, disk_op) in disks.iter().enumerate() {
@@ -428,7 +429,7 @@ async fn build_reconstructed_part_stream(
bucket,
&format!("{}/{}/part.{}", object, files[idx].data_dir.unwrap_or_default(), part_number),
read_offset,
till_offset,
shard_length,
erasure.shard_size(),
checksum_algo.clone(),
skip_verify_bitrot,
@@ -1563,6 +1564,7 @@ impl SetDisks {
let mut readers = Vec::with_capacity(disks.len());
let mut errors = Vec::with_capacity(disks.len());
let shard_length = till_offset.saturating_sub(read_offset);
for (idx, disk_op) in disks.iter().enumerate() {
match create_bitrot_reader(
files[idx].data.as_deref(),
@@ -1570,7 +1572,7 @@ impl SetDisks {
bucket,
&format!("{}/{}/part.{}", object, files[idx].data_dir.unwrap_or_default(), part_number),
read_offset,
till_offset,
shard_length,
erasure.shard_size(),
checksum_algo.clone(),
skip_verify_bitrot,