Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions be/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ option(WITH_MYSQL "Support access MySQL" ON)
option(BUILD_FS_BENCHMARK "ON for building fs benchmark tool or OFF for not" OFF)
message(STATUS "build fs benchmark tool: ${BUILD_FS_BENCHMARK}")

option(BUILD_TASK_EXECUTOR_SIMULATOR "ON for building task executor simulator or OFF for not" OFF)
message(STATUS "build task executor simulator: ${BUILD_TASK_EXECUTOR_SIMULATOR}")

option(BUILD_FILE_CACHE_LRU_TOOL "ON for building file cache lru tool or OFF for not" OFF)
message(STATUS "build file cache lru tool: ${BUILD_FILE_CACHE_LRU_TOOL}")

set(CMAKE_SKIP_RPATH TRUE)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_RUNTIME ON)
Expand Down
6 changes: 6 additions & 0 deletions be/src/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,12 @@ DEFINE_mBool(enable_reader_dryrun_when_download_file_cache, "true");
DEFINE_mInt64(file_cache_background_monitor_interval_ms, "5000");
DEFINE_mInt64(file_cache_background_ttl_gc_interval_ms, "3000");
DEFINE_mInt64(file_cache_background_ttl_gc_batch, "1000");
DEFINE_mInt64(file_cache_background_lru_dump_interval_ms, "60000");
// dump queue only if the queue update specific times through several dump intervals
DEFINE_mInt64(file_cache_background_lru_dump_update_cnt_threshold, "1000");
DEFINE_mInt64(file_cache_background_lru_dump_tail_record_num, "5000000");
DEFINE_mInt64(file_cache_background_lru_log_replay_interval_ms, "1000");
DEFINE_mBool(enable_evaluate_shadow_queue_diff, "false");

DEFINE_Int32(file_cache_downloader_thread_num_min, "32");
DEFINE_Int32(file_cache_downloader_thread_num_max, "32");
Expand Down
7 changes: 7 additions & 0 deletions be/src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,13 @@ DECLARE_mInt64(file_cache_background_ttl_gc_interval_ms);
DECLARE_mInt64(file_cache_background_ttl_gc_batch);
DECLARE_Int32(file_cache_downloader_thread_num_min);
DECLARE_Int32(file_cache_downloader_thread_num_max);
// used to persist lru information before be reboot and load the info back
DECLARE_mInt64(file_cache_background_lru_dump_interval_ms);
// dump queue only if the queue update specific times through several dump intervals
DECLARE_mInt64(file_cache_background_lru_dump_update_cnt_threshold);
DECLARE_mInt64(file_cache_background_lru_dump_tail_record_num);
DECLARE_mInt64(file_cache_background_lru_log_replay_interval_ms);
DECLARE_mBool(enable_evaluate_shadow_queue_diff);

DECLARE_mBool(enable_reader_dryrun_when_download_file_cache);

Expand Down
3 changes: 3 additions & 0 deletions be/src/http/action/file_cache_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ constexpr static std::string_view CAPACITY = "capacity";
constexpr static std::string_view RELEASE = "release";
constexpr static std::string_view BASE_PATH = "base_path";
constexpr static std::string_view RELEASED_ELEMENTS = "released_elements";
constexpr static std::string_view DUMP = "dump";
constexpr static std::string_view VALUE = "value";

Status FileCacheAction::_handle_header(HttpRequest* req, std::string* json_metrics) {
Expand Down Expand Up @@ -127,6 +128,8 @@ Status FileCacheAction::_handle_header(HttpRequest* req, std::string* json_metri
*json_metrics = json.ToString();
}
}
} else if (operation == DUMP) {
io::FileCacheFactory::instance()->dump_all_caches();
} else {
st = Status::InternalError("invalid operation: {}", operation);
}
Expand Down
2 changes: 2 additions & 0 deletions be/src/http/action/shrink_mem_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ void ShrinkMemAction::handle(HttpRequest* req) {
MemoryReclamation::process_minor_gc();
LOG(INFO) << "shrink memory triggered, using Process Minor GC Free Memory";
HttpChannel::send_reply(req, HttpStatus::OK, "shrinking");

ExecEnv::GetInstance()->set_is_upgrading();
}

} // namespace doris
25 changes: 25 additions & 0 deletions be/src/io/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,28 @@ if (${BUILD_FS_BENCHMARK} STREQUAL "ON")
)

endif()

if (${BUILD_FILE_CACHE_LRU_TOOL} STREQUAL "ON")
add_executable(file_cache_lru_tool
cache/file_cache_lru_tool.cpp
)

pch_reuse(file_cache_lru_tool)

# This permits libraries loaded by dlopen to link to the symbols in the program.
set_target_properties(file_cache_lru_tool PROPERTIES ENABLE_EXPORTS 1)

target_link_libraries(file_cache_lru_tool
${DORIS_LINK_LIBS}
)

install(DIRECTORY DESTINATION ${OUTPUT_DIR}/lib/)
install(TARGETS file_cache_lru_tool DESTINATION ${OUTPUT_DIR}/lib/)

add_custom_command(TARGET file_cache_lru_tool POST_BUILD
COMMAND ${CMAKE_OBJCOPY} --only-keep-debug $<TARGET_FILE:file_cache_lru_tool> $<TARGET_FILE:file_cache_lru_tool>.dbg
COMMAND ${CMAKE_STRIP} --strip-debug --strip-unneeded $<TARGET_FILE:file_cache_lru_tool>
COMMAND ${CMAKE_OBJCOPY} --add-gnu-debuglink=$<TARGET_FILE:file_cache_lru_tool>.dbg $<TARGET_FILE:file_cache_lru_tool>
)

endif()
Loading