gavinchou commented on code in PR #40226:
URL: https://github.com/apache/doris/pull/40226#discussion_r1740157216


##########
be/src/io/cache/fs_file_cache_storage.cpp:
##########
@@ -204,8 +205,21 @@ Status FSFileCacheStorage::change_key_meta(const 
FileCacheKey& key, const KeyMet
 
 std::string FSFileCacheStorage::get_path_in_local_cache(const std::string& 
dir, size_t offset,
                                                         FileCacheType type, 
bool is_tmp) {
-    return Path(dir) / (std::to_string(offset) +
-                        (is_tmp ? "_tmp" : 
BlockFileCache::cache_type_to_string(type)));
+    if (is_tmp) {
+        return Path(dir) / (std::to_string(offset) + "_tmp");
+    } else if (type == FileCacheType::TTL) {
+        // TTL maybe end up with '_ttl' (old format) or without (new format)
+        std::string path = Path(dir) / std::to_string(offset);
+        std::error_code ec;
+        bool exists = std::filesystem::exists(path, ec);

Review Comment:
   This is a critical change, introducing extra IO operation, please check the 
performance impact
   ```
   doris::io::FSFileCacheStorage::get_path_in_local_cacheđź”—
   is reference in doris/be/src/io/cache/fs_file_cache_storage.cpp (6)
   doris::io::FSFileCacheStorage::append (1 c)
   doris::io::FSFileCacheStorage::finalize (1 c)
   doris::io::FSFileCacheStorage::read (1 c)
   doris::io::FSFileCacheStorage::remove (1 c)
   doris::io::FSFileCacheStorage::change_key_meta (2 c)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to