Skip to content

enhance: replace stale columns when load-diff groups keep shape but swap files#49066

Open
congqixia wants to merge 1 commit intomilvus-io:masterfrom
congqixia:enhance/loaddiff/compare_detail_files
Open

enhance: replace stale columns when load-diff groups keep shape but swap files#49066
congqixia wants to merge 1 commit intomilvus-io:masterfrom
congqixia:enhance/loaddiff/compare_detail_files

Conversation

@congqixia
Copy link
Copy Markdown
Contributor

Related to #46358

ComputeDiffBinlogs and ComputeDiffColumnGroups in SegmentLoadInfo only compared field-level membership, so a field that stayed under the same group id / column-group index was treated as unchanged even when the underlying files were rewritten (e.g. post-compaction manifests that preserve the column-group layout but point at new parquet files). ApplyLoadDiff gates reader rebuild and column eviction on *_to_replace entries, so the loader silently kept serving stale cached chunks.

Compare the ordered file-path sequence per group and route pre-existing fields into binlogs_to_replace / column_groups_to_replace (respecting the existing eager-vs-lazy policy) when files differ; genuinely new children in a files-changed group still go to binlogs_to_load so the replace path isn't asked to evict a column that was never loaded.

Add SetColumnGroupsForTesting as a narrow hook so unit tests can exercise ComputeDiffColumnGroups without constructing real manifest files, and cover both diff functions for: identical files, different file paths, different file counts, new child under changed files, and non-double-emission for moved fields whose old group's files also changed.

…wap files

Related to milvus-io#46358

ComputeDiffBinlogs and ComputeDiffColumnGroups in SegmentLoadInfo only
compared field-level membership, so a field that stayed under the same
group id / column-group index was treated as unchanged even when the
underlying files were rewritten (e.g. post-compaction manifests that
preserve the column-group layout but point at new parquet files).
ApplyLoadDiff gates reader rebuild and column eviction on *_to_replace
entries, so the loader silently kept serving stale cached chunks.

Compare the ordered file-path sequence per group and route pre-existing
fields into binlogs_to_replace / column_groups_to_replace (respecting
the existing eager-vs-lazy policy) when files differ; genuinely new
children in a files-changed group still go to binlogs_to_load so the
replace path isn't asked to evict a column that was never loaded.

Add SetColumnGroupsForTesting as a narrow hook so unit tests can
exercise ComputeDiffColumnGroups without constructing real manifest
files, and cover both diff functions for: identical files, different
file paths, different file counts, new child under changed files, and
non-double-emission for moved fields whose old group's files also
changed.

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
@sre-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: congqixia

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

The pull request process is described 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 approved size/L Denotes a PR that changes 100-499 lines. labels Apr 15, 2026
@mergify mergify bot added dco-passed DCO check passed. kind/enhancement Issues or changes related to enhancement labels Apr 15, 2026
@sre-ci-robot
Copy link
Copy Markdown
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-default // for ci-v2/e2e-default
  • /ci-rerun-e2e-amd // for ci-v2/e2e-amd (e2e pool dispatcher)
  • /ci-rerun-build-ut-cov // for ci-v2/build-ut-cov (build + unit tests in one pipeline)
  • /ci-rerun-gosdk // for ci-v2/go-sdk (Go SDK E2E tests, ARM)

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

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 15, 2026

Codecov Report

❌ Patch coverage is 95.42857% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.01%. Comparing base (c32ee00) to head (4befcb6).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
internal/core/src/segcore/SegmentLoadInfoTest.cpp 95.13% 7 Missing ⚠️
internal/core/src/segcore/SegmentLoadInfo.cpp 96.77% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #49066      +/-   ##
==========================================
+ Coverage   77.99%   78.01%   +0.01%     
==========================================
  Files        2168     2168              
  Lines      356784   356952     +168     
==========================================
+ Hits       278279   278466     +187     
+ Misses      69941    69918      -23     
- Partials     8564     8568       +4     
Components Coverage Δ
Client 79.25% <ø> (ø)
Core 84.53% <95.42%> (+0.07%) ⬆️
Go 76.28% <ø> (-0.02%) ⬇️
Files with missing lines Coverage Δ
internal/core/src/segcore/SegmentLoadInfo.h 87.96% <ø> (ø)
internal/core/src/segcore/SegmentLoadInfo.cpp 87.20% <96.77%> (+19.89%) ⬆️
internal/core/src/segcore/SegmentLoadInfoTest.cpp 98.84% <95.13%> (-0.66%) ⬇️

... and 43 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 Apr 15, 2026
@mergify mergify bot added the ci-passed label Apr 15, 2026
if (!cur_cg || !new_cg) {
continue;
}
const auto& cur_files = cur_cg->files;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, this all assumes that columns are consistent within column groups. Is there a part logical to verify this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved ci-passed dco-passed DCO check passed. kind/enhancement Issues or changes related to enhancement size/L Denotes a PR that changes 100-499 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants