Skip to content

fix: filter deleted indexes in GetIndexedSegments to prevent stale segment loading#48558

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

fix: filter deleted indexes in GetIndexedSegments to prevent stale segment loading#48558
XuanYang-cn wants to merge 1 commit intomilvus-io:masterfrom
XuanYang-cn:fix-get-indexed-segments

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

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.

See also: milvus-io#48557

Signed-off-by: yangxuan <xuan.yang@zilliz.com>
@sre-ci-robot sre-ci-robot requested review from cydrain and sunby March 26, 2026 11:58
@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
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 wxyucs after the PR has been reviewed.
You can assign the PR to them by writing /assign @wxyucs 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

XuanYang-cn added a commit to XuanYang-cn/milvus that referenced this pull request Mar 26, 2026
…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>
@mergify mergify bot added dco-passed DCO check passed. kind/bug Issues or changes related a bug labels Mar 26, 2026
@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.61%. Comparing base (d02e19d) to head (f755e5e).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #48558      +/-   ##
==========================================
- Coverage   77.61%   77.61%   -0.01%     
==========================================
  Files        2112     2112              
  Lines      351497   351495       -2     
==========================================
- Hits       272822   272810      -12     
- Misses      70330    70342      +12     
+ Partials     8345     8343       -2     
Components Coverage Δ
Client 79.25% <ø> (ø)
Core 84.01% <ø> (ø)
Go 75.77% <100.00%> (-0.01%) ⬇️
Files with missing lines Coverage Δ
internal/datacoord/index_meta.go 91.94% <100.00%> (-0.02%) ⬇️

... and 35 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 the low-code-coverage add test-label from zhikun, diff coverage > 80% label Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-passed DCO check passed. kind/bug Issues or changes related a bug low-code-coverage add test-label from zhikun, diff coverage > 80% 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