From 6605327467cf14c40abdfb6a4464a3601425b643 Mon Sep 17 00:00:00 2001 From: Lan Lou Date: Tue, 30 Apr 2024 11:58:25 -0400 Subject: [PATCH] add comments --- storage-node/src/cache/data_store_cache/memdisk/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/storage-node/src/cache/data_store_cache/memdisk/mod.rs b/storage-node/src/cache/data_store_cache/memdisk/mod.rs index f2f0d87..acab2ee 100644 --- a/storage-node/src/cache/data_store_cache/memdisk/mod.rs +++ b/storage-node/src/cache/data_store_cache/memdisk/mod.rs @@ -294,7 +294,8 @@ impl> 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); @@ -303,6 +304,8 @@ impl> 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);