freemandealer commented on code in PR #54295:
URL: https://github.com/apache/doris/pull/54295#discussion_r2271904494
##########
be/test/io/cache/block_file_cache_test.cpp:
##########
@@ -5322,6 +5323,155 @@ TEST_F(BlockFileCacheTest,
file_cache_path_storage_parse) {
}
}
+TEST_F(BlockFileCacheTest, check_file_cache_consistency) {
+ if (fs::exists(cache_base_path)) {
+ fs::remove_all(cache_base_path);
+ }
+ fs::create_directories(cache_base_path);
+ TUniqueId query_id;
+ query_id.hi = 1;
+ query_id.lo = 1;
+ io::FileCacheSettings settings;
+ settings.query_queue_size = 30;
+ settings.query_queue_elements = 5;
+ settings.index_queue_size = 30;
+ settings.index_queue_elements = 5;
+ settings.disposable_queue_size = 30;
+ settings.disposable_queue_elements = 5;
+ settings.capacity = 90;
+ settings.max_file_block_size = 30;
+ settings.max_query_cache_size = 30;
+ auto key1 = io::BlockFileCache::hash("key1");
+ auto key2 = io::BlockFileCache::hash("key2");
+
+ io::BlockFileCache mgr(cache_base_path, settings);
+ ASSERT_TRUE(mgr.initialize());
+ for (int i = 0; i < 100; i++) {
+ if (mgr.get_async_open_success()) {
+ break;
+ };
+ std::this_thread::sleep_for(std::chrono::milliseconds(1));
+ }
+ io::CacheContext cache_context;
Review Comment:
ReadStatistics rstats;
context.stats = &rstats;
otherwise, BE UT will fail:
```
18:56:36 F20250812 18:56:36.556773 17604 block_file_cache.cpp:738] Check
failed: stats != nullptr
18:56:36 *** Check failure stack trace: ***
18:56:36 @ 0x55ddae05a54f google::LogMessage::SendToLog()
18:56:37 @ 0x55ddae050b60 google::LogMessage::Flush()
18:56:37 @ 0x55ddae054259
google::LogMessageFatal::~LogMessageFatal()
18:56:37 @ 0x55dd8a887ead doris::io::BlockFileCache::get_or_set()
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]