From 66c84655d807cd4a2c04a9f57ecc5631c9a18c78 Mon Sep 17 00:00:00 2001 From: foxspy Date: Wed, 3 Jan 2024 11:10:47 +0800 Subject: [PATCH] fix: [Cherry-pick] throw exception when upload file failed for DiskIndex (#29628) Cherry pick from master pr: #29627 related to: #29417 Signed-off-by: xianliang --- internal/core/src/index/VectorDiskIndex.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/core/src/index/VectorDiskIndex.cpp b/internal/core/src/index/VectorDiskIndex.cpp index 206a5d0beb976..70ab11b0f25d3 100644 --- a/internal/core/src/index/VectorDiskIndex.cpp +++ b/internal/core/src/index/VectorDiskIndex.cpp @@ -90,7 +90,11 @@ template BinarySet VectorDiskAnnIndex::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);