From 3e15604f2eef41bbacbceefaf6cf90848875e632 Mon Sep 17 00:00:00 2001 From: Lanqing Yang Date: Mon, 15 Dec 2025 22:33:16 +0800 Subject: [PATCH] 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 --- internal/core/src/segcore/ChunkedSegmentSealedImpl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/core/src/segcore/ChunkedSegmentSealedImpl.h b/internal/core/src/segcore/ChunkedSegmentSealedImpl.h index 2f3cffa72e..eeb8dcdefb 100644 --- a/internal/core/src/segcore/ChunkedSegmentSealedImpl.h +++ b/internal/core/src/segcore/ChunkedSegmentSealedImpl.h @@ -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 {};