mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 01:28:27 +08:00
enhance: Add log to debug index task (#45198)
Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
This commit is contained in:
parent
ed8ba4a28c
commit
01cf5c9341
@ -305,18 +305,26 @@ VectorMemIndex<T>::BuildWithDataset(const DatasetPtr& dataset,
|
|||||||
SetDim(dataset->GetDim());
|
SetDim(dataset->GetDim());
|
||||||
|
|
||||||
knowhere::TimeRecorder rc("BuildWithoutIds", 1);
|
knowhere::TimeRecorder rc("BuildWithoutIds", 1);
|
||||||
|
LOG_INFO("start build memory index with KNOWHERE, build_id: {}",
|
||||||
|
config.value("build_id", "unknown"));
|
||||||
auto stat = index_.Build(dataset, index_config, use_knowhere_build_pool_);
|
auto stat = index_.Build(dataset, index_config, use_knowhere_build_pool_);
|
||||||
if (stat != knowhere::Status::success)
|
if (stat != knowhere::Status::success)
|
||||||
ThrowInfo(ErrorCode::IndexBuildError,
|
ThrowInfo(ErrorCode::IndexBuildError,
|
||||||
"failed to build index, " + KnowhereStatusString(stat));
|
"failed to build index, " + KnowhereStatusString(stat));
|
||||||
rc.ElapseFromBegin("Done");
|
rc.ElapseFromBegin("Done");
|
||||||
|
LOG_INFO("build memory index with KNOWHERE done, build_id: {}",
|
||||||
|
config.value("build_id", "unknown"));
|
||||||
SetDim(index_.Dim());
|
SetDim(index_.Dim());
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
void
|
void
|
||||||
VectorMemIndex<T>::Build(const Config& config) {
|
VectorMemIndex<T>::Build(const Config& config) {
|
||||||
|
LOG_INFO("start build memory index, build_id: {}",
|
||||||
|
config.value("build_id", "unknown"));
|
||||||
auto field_datas = file_manager_->CacheRawDataToMemory(config);
|
auto field_datas = file_manager_->CacheRawDataToMemory(config);
|
||||||
|
LOG_INFO("CacheRawDataToMemory success, build_id: {}",
|
||||||
|
config.value("build_id", "unknown"));
|
||||||
auto opt_fields = GetValueFromConfig<OptFieldT>(config, VEC_OPT_FIELDS);
|
auto opt_fields = GetValueFromConfig<OptFieldT>(config, VEC_OPT_FIELDS);
|
||||||
std::unordered_map<int64_t, std::vector<std::vector<uint32_t>>> scalar_info;
|
std::unordered_map<int64_t, std::vector<std::vector<uint32_t>>> scalar_info;
|
||||||
auto is_partition_key_isolation =
|
auto is_partition_key_isolation =
|
||||||
|
|||||||
@ -41,6 +41,9 @@ VecIndexCreator::VecIndexCreator(
|
|||||||
config_[DIM_KEY] = file_manager_context.indexMeta.dim;
|
config_[DIM_KEY] = file_manager_context.indexMeta.dim;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
config_["build_id"] =
|
||||||
|
std::to_string(file_manager_context.indexMeta.build_id);
|
||||||
|
|
||||||
index::CreateIndexInfo index_info;
|
index::CreateIndexInfo index_info;
|
||||||
index_info.field_type = data_type_;
|
index_info.field_type = data_type_;
|
||||||
index_info.index_type = index::GetIndexTypeFromConfig(config_);
|
index_info.index_type = index::GetIndexTypeFromConfig(config_);
|
||||||
|
|||||||
@ -243,7 +243,11 @@ CreateIndex(CIndex* res_index,
|
|||||||
index_non_encoding};
|
index_non_encoding};
|
||||||
auto chunk_manager =
|
auto chunk_manager =
|
||||||
milvus::storage::CreateChunkManager(storage_config);
|
milvus::storage::CreateChunkManager(storage_config);
|
||||||
|
LOG_INFO("create chunk manager success, build_id: {}",
|
||||||
|
build_index_info->buildid());
|
||||||
auto fs = milvus::storage::InitArrowFileSystem(storage_config);
|
auto fs = milvus::storage::InitArrowFileSystem(storage_config);
|
||||||
|
LOG_INFO("init arrow file system success, build_id: {}",
|
||||||
|
build_index_info->buildid());
|
||||||
|
|
||||||
milvus::storage::FileManagerContext fileManagerContext(
|
milvus::storage::FileManagerContext fileManagerContext(
|
||||||
field_meta, index_meta, chunk_manager, fs);
|
field_meta, index_meta, chunk_manager, fs);
|
||||||
@ -268,7 +272,10 @@ CreateIndex(CIndex* res_index,
|
|||||||
auto index =
|
auto index =
|
||||||
milvus::indexbuilder::IndexFactory::GetInstance().CreateIndex(
|
milvus::indexbuilder::IndexFactory::GetInstance().CreateIndex(
|
||||||
field_type, config, fileManagerContext);
|
field_type, config, fileManagerContext);
|
||||||
|
LOG_INFO("create index instance success, build_id: {}",
|
||||||
|
build_index_info->buildid());
|
||||||
index->Build();
|
index->Build();
|
||||||
|
LOG_INFO("build index done, build_id: {}", build_index_info->buildid());
|
||||||
*res_index = index.release();
|
*res_index = index.release();
|
||||||
auto status = CStatus();
|
auto status = CStatus();
|
||||||
status.error_code = Success;
|
status.error_code = Success;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user