Skip to content

fix: filter deleted indexes in GetIndexedSegments to prevent stale segment loading [2.6]#48559

Open
XuanYang-cn wants to merge 1 commit intomilvus-io:2.6from
XuanYang-cn:fix-get-indexed-segments-2.6
Open

fix: filter deleted indexes in GetIndexedSegments to prevent stale segment loading [2.6]#48559
XuanYang-cn wants to merge 1 commit intomilvus-io:2.6from
XuanYang-cn:fix-get-indexed-segments-2.6

Conversation

@XuanYang-cn
Copy link
Contributor

Summary

  • Filter out deleted index entries from targetIndices in GetIndexedSegments, fixing a mismatch where len(targetIndices) included deleted entries but the counting loop skipped them
  • After drop+create index cycles, this caused all segments to appear unindexed, forcing GetQueryVChanPositions to load stale pre-compaction segments instead of the optimized one

pr: #48558
issue: #48557

Signed-off-by: yangxuan xuan.yang@zilliz.com

…gment loading

GetIndexedSegments included deleted index entries in targetIndices but
skipped them in the counting loop, causing indexedFields to never equal
len(targetIndices) when deleted entries existed. This made every segment
appear unindexed after drop+create index cycles, forcing
GetQueryVChanPositions to fall back to loading stale pre-compaction
segments instead of the optimized one.

pr: milvus-io#48558
See also: milvus-io#48557

Signed-off-by: yangxuan <xuan.yang@zilliz.com>
@sre-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: XuanYang-cn
To complete the pull request process, please assign jiaoew1991 after the PR has been reviewed.
You can assign the PR to them by writing /assign @jiaoew1991 in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sre-ci-robot sre-ci-robot added the size/M Denotes a PR that changes 30-99 lines. label Mar 26, 2026
@sre-ci-robot sre-ci-robot requested review from congqixia and sunby March 26, 2026 11:59
@mergify mergify bot added dco-passed DCO check passed. kind/bug Issues or changes related a bug labels Mar 26, 2026
@sre-ci-robot sre-ci-robot added do-not-merge/need-merge-master-first any pr merge to release branch need to merge master first do-not-merge/need-milestone generate by v2-label-manager labels Mar 26, 2026
@sre-ci-robot
Copy link
Contributor

[INFO] PR Label Summary by Default
[FAILED] PR #48558 not merged

[WARNING] Milestone not set

You can set milestone by commenting:
/set-milestone
Example:
/set-milestone 2.5.0

Use /refresh-label to update related check and label manually

@sre-ci-robot
Copy link
Contributor

[ci-v2-notice]
Notice: New ci-v2 system is enabled for this PR.

To rerun ci-v2 checks, comment with:

  • /ci-rerun-code-check // for ci-v2/code-check
  • /ci-rerun-build // for ci-v2/build
  • /ci-rerun-build-all // for ci-v2/build-all (multi-arch builds)
  • /ci-rerun-buildenv // for ci-v2/build-env (build milvus-env builder images)
  • /ci-rerun-ut-integration // for ci-v2/ut-integration, will rerun ci-v2/build
  • /ci-rerun-ut-go // for ci-v2/ut-go, will rerun ci-v2/build
  • /ci-rerun-ut-cpp // for ci-v2/ut-cpp
  • /ci-rerun-ut // for all ci-v2/ut-integration, ci-v2/ut-go, ci-v2/ut-cpp, will rerun ci-v2/build
  • /ci-rerun-e2e-arm // for ci-v2/e2e-arm
  • /ci-rerun-e2e-default // for ci-v2/e2e-default
  • /ci-rerun-ciloop // for ci-v2/ciloop (build + unit tests in one pipeline)
  • /ci-rerun-gosdk // for ci-v2/go-sdk (Go SDK E2E tests, AMD)
  • /ci-rerun-gosdk-arm // for ci-v2/go-sdk-arm (Go SDK E2E tests, ARM)

If you have any questions or requests, please contact @zhikunyao.

@codecov
Copy link

codecov bot commented Mar 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.27%. Comparing base (cb08db0) to head (4388b5d).
⚠️ Report is 734 commits behind head on 2.6.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              2.6   #48559      +/-   ##
==========================================
+ Coverage   76.99%   77.27%   +0.28%     
==========================================
  Files        1700     1960     +260     
  Lines      262533   309561   +47028     
==========================================
+ Hits       202142   239220   +37078     
- Misses      53550    62808    +9258     
- Partials     6841     7533     +692     
Components Coverage Δ
Client 79.48% <78.30%> (+1.33%) ⬆️
Core 83.39% <93.03%> (+1.18%) ⬆️
Go 75.88% <52.12%> (+0.50%) ⬆️
Files with missing lines Coverage Δ
internal/datacoord/index_meta.go 92.11% <100.00%> (+0.13%) ⬆️

... and 1272 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sre-ci-robot sre-ci-robot added low-code-coverage add test-label from zhikun, diff coverage > 80% and removed low-code-coverage add test-label from zhikun, diff coverage > 80% labels Mar 26, 2026
@mergify mergify bot added the ci-passed label Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-passed dco-passed DCO check passed. do-not-merge/need-merge-master-first any pr merge to release branch need to merge master first do-not-merge/need-milestone generate by v2-label-manager kind/bug Issues or changes related a bug size/M Denotes a PR that changes 30-99 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants