Skip to content

Commit a4e7731

Browse files
committed
Add fast slow store for update with whole file
1 parent d73481d commit a4e7731

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

nativelink-store/src/fast_slow_store.rs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,10 +556,20 @@ impl StoreDriver for FastSlowStore {
556556
{
557557
return Ok(Some(file));
558558
}
559-
return self
559+
return match self
560560
.fast_store
561561
.update_with_whole_file(key, path, file, upload_size)
562-
.await;
562+
.await
563+
{
564+
Ok(file_slot) => Ok(file_slot),
565+
Err(err) => {
566+
warn!(
567+
?err,
568+
"FastSlowStore::update_with_whole_file: fast store failed; data stored in slow store",
569+
);
570+
Ok(None)
571+
}
572+
};
563573
}
564574

565575
if self
@@ -573,14 +583,19 @@ impl StoreDriver for FastSlowStore {
573583
|| self.fast_direction == StoreDirection::ReadOnly
574584
|| self.fast_direction == StoreDirection::Get;
575585
if !ignore_fast {
576-
slow_update_store_with_file(
586+
if let Err(err) = slow_update_store_with_file(
577587
self.fast_store.as_store_driver_pin(),
578588
key.borrow(),
579589
&mut file,
580590
upload_size,
581591
)
582592
.await
583-
.err_tip(|| "In FastSlowStore::update_with_whole_file fast_store")?;
593+
{
594+
warn!(
595+
?err,
596+
"FastSlowStore::update_with_whole_file: fast store failed; continuing with slow store",
597+
);
598+
}
584599
}
585600
let ignore_slow = self.slow_direction == StoreDirection::ReadOnly
586601
|| self.slow_direction == StoreDirection::Get;

0 commit comments

Comments
 (0)