freemandealer commented on issue #41280: URL: https://github.com/apache/doris/issues/41280#issuecomment-2451215861
hi @Lupinus > In FileCacheStorage, add a virtual function unordered_set checkConsistency(BlockFileCache* _mgr, lambda handler) We don't need _mgr as its parameter since the call chain is as follows: FileCacheAction -> BlockFileCache(holding _mutex) -> specific storage > checking for their existence in _files of BlockFileCache and whether their sizes are consistent. Additionally, please consider the consistency of their metadata. Please take a look at `FileBlock::cache_type()` & `FileBlock::expiration_time()`. These metadata are encoded into the directory name and file name in the filesystem and refer to `FSFileCacheStorage::load_cache_info_into_memory` for details. BTW, when using unorderd_map, the map key should include all the above-mentioned info because the file path itself could be duplicated (but with different cache types or expiration_time). > Is it ok for the API's return to be inconsistent file names and offsets? Given that the inconsistency could be in two categories, i.e. missing in _files v.s. missing in filesystem, we should point that out along with the file path (not file name alone, should be file path) in the HTTP reponse. > Any suggestions regarding function naming? It is a frustrating issue. No problem with the naming. And what do you mean by 'a frustrating issue'? Is it too easy or hard for you? If there is any problem with the issue itself, please help me improve it. I appreciate your help in advance. -- 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