fix: use rlock for pinindex (#45932)

fixes: https://github.com/milvus-io/milvus/issues/45934
pinIndex is a const and only do read operations rlock would be the right
choice for performance

Signed-off-by: Lanqing Yang <lanqingy93@gmail.com>
This commit is contained in:
Lanqing Yang 2025-12-15 22:33:16 +08:00 committed by GitHub
parent ab90dd287f
commit 3e15604f2e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -89,7 +89,7 @@ class ChunkedSegmentSealedImpl : public SegmentSealed {
FieldId field_id,
bool include_ngram = false) const override {
auto [scalar_indexings, ngram_fields] =
lock(folly::wlock(scalar_indexings_), folly::wlock(ngram_fields_));
lock(folly::rlock(scalar_indexings_), folly::rlock(ngram_fields_));
if (!include_ngram) {
if (ngram_fields->find(field_id) != ngram_fields->end()) {
return {};