fix: throw exception when upload file failed for DiskIndex (#29627)

related to : #29417 

cardinal indexes upload index files in `Serialize` interface, and throw
exception when the `Serialize` failed.

Signed-off-by: xianliang <xianliang.li@zilliz.com>
pull/29745/head
foxspy 2024-01-07 20:03:13 +08:00 committed by GitHub
parent 635a7f777c
commit 271edc6669
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -134,7 +134,11 @@ template <typename T>
BinarySet
VectorDiskAnnIndex<T>::Upload(const Config& config) {
BinarySet ret;
index_.Serialize(ret);
auto stat = index_.Serialize(ret);
if (stat != knowhere::Status::success) {
PanicInfo(ErrorCode::UnexpectedError,
"failed to serialize index, " + KnowhereStatusString(stat));
}
auto remote_paths_to_size = file_manager_->GetRemotePathsToFileSize();
for (auto& file : remote_paths_to_size) {
ret.Append(file.first, nullptr, file.second);