Skip to content

Commit

Permalink
Add log to Issue infiniflow#2119.
Browse files Browse the repository at this point in the history
  • Loading branch information
small-turtle-1 committed Nov 7, 2024
1 parent b9179a3 commit 6ef9f21
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/collect_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
print("Error: stdout file not found")
else:
if failure:
shutil.copy(stdout_path, f"{output_dir}/{random_name}_1.log")
shutil.copy(stdout_path, f"{output_dir}/{random_name}_stdout.log")
print(f"Last {show_lines} lines from {stdout_path}:")
with open(stdout_path, "r") as f:
lines = f.readlines()
Expand All @@ -63,7 +63,7 @@
print("Error: stderror file not found")
else:
if failure:
shutil.copy(stderror_path, f"{output_dir}/{random_name}_2.log")
shutil.copy(stderror_path, f"{output_dir}/{random_name}_stderror.log")
print(f"Last {show_lines} lines from {stderror_path}:")
with open(stderror_path, "r") as f:
lines = f.readlines()
Expand Down
2 changes: 2 additions & 0 deletions src/main/infinity_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,12 +441,14 @@ void InfinityContext::SetIndexThreadPool(SizeT thread_num) {
thread_num = thread_num / 2;
if (thread_num < 2)
thread_num = 2;
LOG_TRACE(fmt::format("Set index thread pool size to {}", thread_num));
inverting_thread_pool_.resize(thread_num);
commiting_thread_pool_.resize(thread_num);
hnsw_build_thread_pool_.resize(thread_num);
}

void InfinityContext::RestoreIndexThreadPoolToDefault() {
LOG_TRACE("Restore index thread pool size to default");
inverting_thread_pool_.resize(4);
commiting_thread_pool_.resize(2);
hnsw_build_thread_pool_.resize(4);
Expand Down
3 changes: 3 additions & 0 deletions src/storage/knn_index/knn_hnsw/abstract_hnsw.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ private:
template <typename Iter, typename Index>
static void InsertVecs(Index &index, Iter &&iter, const HnswInsertConfig &config, SizeT &mem_usage) {
auto &thread_pool = InfinityContext::instance().GetHnswBuildThreadPool();
if (thread_pool.size() == 0) {
UnrecoverableError("Hnsw build thread pool is not initialized.");
}
using T = std::decay_t<decltype(index)>;
if constexpr (!std::is_same_v<T, std::nullptr_t>) {
SizeT mem1 = index->mem_usage();
Expand Down

0 comments on commit 6ef9f21

Please sign in to comment.