fix: failed to get raw data for hybrid index(#45318) (#45408)

related: #45318
pr: https://github.com/milvus-io/milvus/pull/45411

Signed-off-by: MrPresent-Han <chun.han@gmail.com>
Co-authored-by: MrPresent-Han <chun.han@gmail.com>
This commit is contained in:
Chun Han 2025-11-13 17:09:37 +08:00 committed by GitHub
parent e4adb9fc56
commit a12444e3ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -159,6 +159,10 @@ ChunkedSegmentSealedImpl::LoadScalarIndex(const LoadIndexInfo& info) {
auto is_pk = field_id == schema_->get_primary_field_id(); auto is_pk = field_id == schema_->get_primary_field_id();
LOG_INFO("LoadScalarIndex, fieldID:{}. segmentID:{}, is_pk:{}",
info.field_id,
id_,
is_pk);
// if segment is pk sorted, user created indexes bring no performance gain but extra memory usage // if segment is pk sorted, user created indexes bring no performance gain but extra memory usage
if (is_pk && is_sorted_by_pk_) { if (is_pk && is_sorted_by_pk_) {
LOG_INFO( LOG_INFO(
@ -231,6 +235,11 @@ ChunkedSegmentSealedImpl::LoadScalarIndex(const LoadIndexInfo& info) {
// need the pk field again. // need the pk field again.
fields_.rlock()->at(field_id)->ManualEvictCache(); fields_.rlock()->at(field_id)->ManualEvictCache();
} }
LOG_INFO(
"Has load scalar index done, fieldID:{}. segmentID:{}, has_raw_data:{}",
info.field_id,
id_,
request.has_raw_data);
} }
void void
@ -2596,19 +2605,23 @@ ChunkedSegmentSealedImpl::FinishLoad() {
std::unique_lock lck(mutex_); std::unique_lock lck(mutex_);
for (const auto& [field_id, field_meta] : schema_->get_fields()) { for (const auto& [field_id, field_meta] : schema_->get_fields()) {
if (field_id.get() < START_USER_FIELDID) { if (field_id.get() < START_USER_FIELDID) {
// no filling system fields
continue; continue;
} }
// cannot use is_field_exist, since it check schema only if (get_bit(field_data_ready_bitset_, field_id)) {
// this shall check the ready bitset here // no filling fields that data already loaded
if (!get_bit(field_data_ready_bitset_, field_id) && continue;
!get_bit(index_ready_bitset_, field_id)) {
// vector field is not supported to be "added field", thus if a vector
// field is absent, it means for some reason we want to skip loading this
// field.
if (!IsVectorDataType(field_meta.get_data_type())) {
fill_empty_field(field_meta);
}
} }
if (get_bit(index_ready_bitset_, field_id) &&
(index_has_raw_data_[field_id])) {
// no filling fields that index already loaded and has raw data
continue;
}
if (IsVectorDataType(field_meta.get_data_type())) {
// no filling vector fields
continue;
}
fill_empty_field(field_meta);
} }
} }