This commit is contained in:
Nicholas Wehr
2025-08-21 23:50:10 -07:00
parent cdb0f9e8a2
commit fae4b4c8f9
2 changed files with 3 additions and 3 deletions

View File

@ -81,16 +81,15 @@ where
Arc::new(tokio::sync::Mutex::new(HashSet::new())); Arc::new(tokio::sync::Mutex::new(HashSet::new()));
tokio::spawn({ tokio::spawn({
warn!("hlfs: backfiller started");
let backfiller = backfiller.clone(); let backfiller = backfiller.clone();
async move { async move {
loop { loop {
let mut bf = backfiller.lock().await; let mut bf = backfiller.lock().await;
warn!("hlfs: backfiller started");
if bf.client.max_block < bf.max_block_seen { if bf.client.max_block < bf.max_block_seen {
let block = bf.client.max_block + 1; let block = bf.client.max_block + 1;
let _ = bf.fetch_if_missing(block).await; let _ = bf.fetch_if_missing(block).await;
} }
sleep(Duration::from_secs(1)).await; sleep(Duration::from_secs(1)).await;
} }
} }

View File

@ -338,7 +338,7 @@ impl Backfiller {
let path = format!("{}/{f}/{s}/{number}.rmp.lz4", self.root.to_string_lossy()); let path = format!("{}/{f}/{s}/{number}.rmp.lz4", self.root.to_string_lossy());
if Path::new(&path).exists() { if Path::new(&path).exists() {
trace!(block = number, "hlfs: already have"); debug!(block = number, "hlfs: already have");
return Ok(None); return Ok(None);
} }
match self.client.wants_block(number, rr_index).await { match self.client.wants_block(number, rr_index).await {
@ -356,6 +356,7 @@ impl Backfiller {
warn!(%path, "hlfs: write failed: {e}"); warn!(%path, "hlfs: write failed: {e}");
return Ok(None); return Ok(None);
} }
debug!(block = number, "hlfs: got block");
Ok(Some(data.len())) Ok(Some(data.len()))
} }
} }