mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-30 23:45:28 +08:00
fix: fill partition_id in load index info and close RemoteOutputStream properly (#46203)
This PR fixes two issues related to segment loading and index deserialization: 1. Fill partition_id in LoadIndexInfo when converting field index info, which is required by cardinal (DiskANN) index deserialization. 2. Close RemoteOutputStream in destructor to ensure buffer flushed and resources released properly. issue: #46141 Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
parent
8fac376afd
commit
728cdc15b2
@ -259,6 +259,7 @@ ChunkedSegmentSealedImpl::ConvertFieldIndexInfoToLoadIndexInfo(
|
||||
// Extract field ID
|
||||
auto field_id = FieldId(field_index_info->fieldid());
|
||||
load_index_info.field_id = field_id.get();
|
||||
load_index_info.partition_id = segment_load_info_.partitionid();
|
||||
|
||||
// Get field type from schema
|
||||
const auto& field_meta = get_schema()[field_id];
|
||||
|
||||
@ -11,6 +11,12 @@ RemoteOutputStream::RemoteOutputStream(
|
||||
: output_stream_(std::move(output_stream)) {
|
||||
}
|
||||
|
||||
RemoteOutputStream::~RemoteOutputStream() {
|
||||
// temp solution, will expose `Close` method in OutputStream later
|
||||
auto status = output_stream_->Close();
|
||||
AssertInfo(status.ok(), "Failed to close output stream");
|
||||
}
|
||||
|
||||
size_t
|
||||
RemoteOutputStream::Tell() const {
|
||||
auto status = output_stream_->Tell();
|
||||
|
||||
@ -21,7 +21,7 @@ class RemoteOutputStream : public milvus::OutputStream {
|
||||
explicit RemoteOutputStream(
|
||||
std::shared_ptr<arrow::io::OutputStream>&& output_stream);
|
||||
|
||||
~RemoteOutputStream() override = default;
|
||||
~RemoteOutputStream() override;
|
||||
|
||||
size_t
|
||||
Tell() const override;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user