enhance: [Pick] Handle knowhere error for creare diskann index (#28691)

master pr: #28690

Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
pull/28726/head^2
cai.zhang 2023-11-26 18:58:25 +08:00 committed by GitHub
parent 6512b12fba
commit 3b06db1d04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -130,7 +130,10 @@ VectorDiskAnnIndex<T>::Build(const Config& config) {
}
knowhere::DataSet* ds_ptr = nullptr;
build_config.erase("insert_files");
index_.Build(*ds_ptr, build_config);
auto stat = index_.Build(*ds_ptr, build_config);
if (stat != knowhere::Status::success)
PanicInfo(ErrorCode::IndexBuildError,
"failed to build disk index, " + KnowhereStatusString(stat));
local_chunk_manager->RemoveDir(
storage::GetSegmentRawDataPathPrefix(local_chunk_manager, segment_id));