Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Skip erase field if index build on PK field #39370

Merged
merged 4 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion internal/core/src/segcore/ChunkedSegmentSealedImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,10 @@
set_bit(index_ready_bitset_, field_id, true);
update_row_count(row_count);
// release field column if the index contains raw data
// only release non-primary field when in pk sorted mode
if (scalar_indexings_[field_id]->HasRawData() &&
get_bit(field_data_ready_bitset_, field_id)) {
get_bit(field_data_ready_bitset_, field_id) &&
(schema_->get_primary_field_id() != field_id || !is_sorted_by_pk_)) {

Check warning on line 235 in internal/core/src/segcore/ChunkedSegmentSealedImpl.cpp

View check run for this annotation

Codecov / codecov/patch

internal/core/src/segcore/ChunkedSegmentSealedImpl.cpp#L235

Added line #L235 was not covered by tests
fields_.erase(field_id);
set_bit(field_data_ready_bitset_, field_id, false);
}
Expand Down
4 changes: 3 additions & 1 deletion internal/core/src/segcore/SegmentSealedImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,10 @@ SegmentSealedImpl::LoadScalarIndex(const LoadIndexInfo& info) {
set_bit(index_ready_bitset_, field_id, true);
update_row_count(row_count);
// release field column if the index contains raw data
// only release non-primary field
if (scalar_indexings_[field_id]->HasRawData() &&
get_bit(field_data_ready_bitset_, field_id)) {
get_bit(field_data_ready_bitset_, field_id) &&
(schema_->get_primary_field_id() != field_id || !is_sorted_by_pk_)) {
fields_.erase(field_id);
set_bit(field_data_ready_bitset_, field_id, false);
}
Expand Down
Loading