Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lanlou1554 committed Apr 30, 2024
1 parent 6805765 commit 6605327
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion storage-node/src/cache/data_store_cache/memdisk/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,8 @@ impl<R: DataStoreReplacer<MemDiskStoreReplacerKey, MemDiskStoreReplacerValue>> D
}
}
Status::MemCompleted => {
// not be notified
// This code only applies to: a thread tries to `put_data_to_cache` but the data is already in cache
// and not be evicted. It is not wait and notified situation.
let mut mem_replacer = self.mem_replacer.as_ref().unwrap().lock().await;
if mem_replacer.peek(&remote_location).is_some() {
mem_replacer.pin(&remote_location, 1);
Expand All @@ -303,6 +304,8 @@ impl<R: DataStoreReplacer<MemDiskStoreReplacerKey, MemDiskStoreReplacerValue>> D
// If mem_replacer has no data, then update status_of_keys
}
Status::DiskCompleted => {
// This code only applies to: a thread tries to `put_data_to_cache` but the data is already in cache
// and not be evicted. It is not wait and notified situation.
let mut disk_replacer = self.disk_replacer.lock().await;
if disk_replacer.peek(&remote_location).is_some() {
disk_replacer.pin(&remote_location, 1);
Expand Down

0 comments on commit 6605327

Please sign in to comment.