progress: expose bytes_retryable so 'lost' counts only failed reads
Add PassProgress::bytes_retryable_total (NonTrimmed/NonScraped — failed and awaiting retry), distinct from bytes_pending_total which also folds in not-yet-attempted (NonTried) bytes. Set it at every construction site (Sweep from the snapshot, Patch from stats, 0 for sequential/placeholder paths). The disc-level 'lost' display in the CLI can now use unreadable+retryable instead of unreadable+pending, so a healthy in-progress rip no longer reports its unread remainder as lost.
This commit is contained in:
+16
-8
@@ -3180,14 +3180,21 @@ impl Disc {
|
||||
// already sent — Anomaly B in the 0.18.1 prod test was
|
||||
// this regression: a stale early snapshot pinned the
|
||||
// display to 0 GB while bytes_done was already advancing.
|
||||
let (bytes_good, bytes_unreadable, bytes_pending) = match &cached_snapshot {
|
||||
Some(snap) => (
|
||||
snap.stats.bytes_good.max(bytes_done),
|
||||
snap.stats.bytes_unreadable,
|
||||
snap.stats.bytes_pending,
|
||||
),
|
||||
None => (bytes_done, 0u64, total_bytes.saturating_sub(bytes_done)),
|
||||
};
|
||||
let (bytes_good, bytes_unreadable, bytes_pending, bytes_retryable) =
|
||||
match &cached_snapshot {
|
||||
Some(snap) => (
|
||||
snap.stats.bytes_good.max(bytes_done),
|
||||
snap.stats.bytes_unreadable,
|
||||
snap.stats.bytes_pending,
|
||||
snap.stats.bytes_retryable,
|
||||
),
|
||||
None => (
|
||||
bytes_done,
|
||||
0u64,
|
||||
total_bytes.saturating_sub(bytes_done),
|
||||
0u64,
|
||||
),
|
||||
};
|
||||
let pp = crate::progress::PassProgress {
|
||||
kind: crate::progress::PassKind::Sweep,
|
||||
work_done: pos,
|
||||
@@ -3195,6 +3202,7 @@ impl Disc {
|
||||
bytes_good_total: bytes_good,
|
||||
bytes_unreadable_total: bytes_unreadable,
|
||||
bytes_pending_total: bytes_pending,
|
||||
bytes_retryable_total: bytes_retryable,
|
||||
bytes_total_disc: total_bytes,
|
||||
disc_duration_secs: main_title.map(|t| t.duration_secs),
|
||||
bytes_bad_in_main_title: main_title_bad,
|
||||
|
||||
Reference in New Issue
Block a user