Skip to content

Commit

Permalink
fix: can't find Chunk struct after growing support mmap (milvus-io#33951
Browse files Browse the repository at this point in the history
)

issue: milvus-io#32984

Signed-off-by: cqy123456 <qianya.cheng@zilliz.com>
  • Loading branch information
cqy123456 authored and yellow-shine committed Jul 2, 2024
1 parent 6e2fb06 commit ff0fe1e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions internal/core/src/segcore/SegmentSealedImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1561,17 +1561,20 @@ SegmentSealedImpl::mask_with_timestamps(BitsetType& bitset_chunk,
// TODO change the
AssertInfo(insert_record_.timestamps_.num_chunk() == 1,
"num chunk not equal to 1 for sealed segment");
const auto& timestamps_data = insert_record_.timestamps_.get_chunk(0);
AssertInfo(timestamps_data.size() == get_row_count(),
auto timestamps_data =
(const milvus::Timestamp*)insert_record_.timestamps_.get_chunk_data(0);
auto timestamps_data_size = insert_record_.timestamps_.get_chunk_size(0);

AssertInfo(timestamps_data_size == get_row_count(),
fmt::format("Timestamp size not equal to row count: {}, {}",
timestamps_data.size(),
timestamps_data_size,
get_row_count()));
auto range = insert_record_.timestamp_index_.get_active_range(timestamp);

// range == (size_, size_) and size_ is this->timestamps_.size().
// it means these data are all useful, we don't need to update bitset_chunk.
// It can be thought of as an OR operation with another bitmask that is all 0s, but it is not necessary to do so.
if (range.first == range.second && range.first == timestamps_data.size()) {
if (range.first == range.second && range.first == timestamps_data_size) {
// just skip
return;
}
Expand All @@ -1582,7 +1585,7 @@ SegmentSealedImpl::mask_with_timestamps(BitsetType& bitset_chunk,
return;
}
auto mask = TimestampIndex::GenerateBitset(
timestamp, range, timestamps_data.data(), timestamps_data.size());
timestamp, range, timestamps_data, timestamps_data_size);
bitset_chunk |= mask;
}

Expand Down

0 comments on commit ff0fe1e

Please sign in to comment.