Skip to content

Commit 3ac4b2f

Browse files
author
MrPresent-Han
committed
fix: failed to get raw data for hybrid index(#45318)
Signed-off-by: MrPresent-Han <chun.han@gmail.com>
1 parent e1ea30b commit 3ac4b2f

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

internal/core/src/segcore/ChunkedSegmentSealedImpl.cpp

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ ChunkedSegmentSealedImpl::LoadScalarIndex(const LoadIndexInfo& info) {
159159

160160
auto is_pk = field_id == schema_->get_primary_field_id();
161161

162+
LOG_INFO("LoadScalarIndex, fieldID:{}. segmentID:{}, is_pk:{}",
163+
info.field_id,
164+
id_,
165+
is_pk);
162166
// if segment is pk sorted, user created indexes bring no performance gain but extra memory usage
163167
if (is_pk && is_sorted_by_pk_) {
164168
LOG_INFO(
@@ -231,6 +235,10 @@ ChunkedSegmentSealedImpl::LoadScalarIndex(const LoadIndexInfo& info) {
231235
// need the pk field again.
232236
fields_.rlock()->at(field_id)->ManualEvictCache();
233237
}
238+
LOG_INFO("Has load scalar index done, fieldID:{}. segmentID:{}, has_raw_data:{}",
239+
info.field_id,
240+
id_,
241+
request.has_raw_data);
234242
}
235243

236244
void
@@ -2581,19 +2589,22 @@ ChunkedSegmentSealedImpl::FinishLoad() {
25812589
std::unique_lock lck(mutex_);
25822590
for (const auto& [field_id, field_meta] : schema_->get_fields()) {
25832591
if (field_id.get() < START_USER_FIELDID) {
2592+
// no filling system fields
25842593
continue;
25852594
}
2586-
// cannot use is_field_exist, since it check schema only
2587-
// this shall check the ready bitset here
2588-
if (!get_bit(field_data_ready_bitset_, field_id) &&
2589-
!get_bit(index_ready_bitset_, field_id)) {
2590-
// vector field is not supported to be "added field", thus if a vector
2591-
// field is absent, it means for some reason we want to skip loading this
2592-
// field.
2593-
if (!IsVectorDataType(field_meta.get_data_type())) {
2594-
fill_empty_field(field_meta);
2595-
}
2595+
if (get_bit(field_data_ready_bitset_, field_id)){
2596+
// no filling fields that data already loaded
2597+
continue;
2598+
}
2599+
if (get_bit(index_ready_bitset_, field_id)&&(index_has_raw_data_[field_id])) {
2600+
// no filling fields that index already loaded and has raw data
2601+
continue;
2602+
}
2603+
if (IsVectorDataType(field_meta.get_data_type())){
2604+
// no filling vector fields
2605+
continue;
25962606
}
2607+
fill_empty_field(field_meta);
25972608
}
25982609
}
25992610

0 commit comments

Comments
 (0)