mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-06 17:18:35 +08:00
issue: #41570 Fix issue where growing and sealed segments could be searched simultaneously, causing inflated count(*) results. This was caused by logic introduced in PR #42009 that made sealed segments readable before target version advancement. Changes include: - Fix conditional filtering logic in PinReadableSegments to prevent sealed segments from becoming readable prematurely - Use target version filter for full results (ratio=1.0) to ensure sealed segments only become readable after target advancement - Use query view segment list filter for partial results (ratio<1.0) to maintain backward compatibility - Simplify target version setting in AddDistributions to prevent premature segment readability - Add logging for redundant growing segments during sync - Add comprehensive unit tests covering the duplicate segment scenario This fix ensures count(*) queries return accurate results by preventing the same segment from being counted in both growing and sealed states. --------- Signed-off-by: Wei Liu <wei.liu@zilliz.com>