fix: data race when accessing field_ when retrieving (#39151)

issue: #39148

Signed-off-by: chyezh <chyezh@outlook.com>
pull/39212/head
Zhen Ye 2025-01-13 11:23:04 +08:00 committed by GitHub
parent cc5d59392a
commit 5f94954bb4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -1591,7 +1591,11 @@ SegmentSealedImpl::bulk_subscript(
return fill_with_empty(field_id, 0);
}
auto column = fields_.at(field_id);
std::shared_ptr<SingleChunkColumnBase> column;
{
std::shared_lock lck(mutex_);
column = fields_.at(field_id);
}
auto ret = fill_with_empty(field_id, count);
if (column->IsNullable()) {
auto dst = ret->mutable_valid_data()->mutable_data();