Skip to content

Conversation

@XuanYang-cn
Copy link
Contributor

See also: #46758

@sre-ci-robot sre-ci-robot requested review from cydrain and sunby January 6, 2026 11:32
@sre-ci-robot sre-ci-robot added the size/L Denotes a PR that changes 100-499 lines. label Jan 6, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello @XuanYang-cn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the force merge compaction mechanism by introducing the ability to specify a target segment size and by implementing a topology-aware calculation for merged segments. The changes aim to improve compaction efficiency and resource utilization by aligning segment sizes and counts with the underlying cluster architecture, particularly considering QueryNode parallelism, replicas, and shards.

Highlights

  • User-Provided Target Size: The force merge compaction now allows specifying a target segment size, with a validation check to ensure it's not smaller than the configured maximum segment size.
  • Topology-Aware Compaction: The segment calculation logic has been enhanced to consider the cluster's topology, including the number of QueryNodes, replicas, and shards, to optimize the segment count for parallel loading.
  • Compaction View Refactoring: Internal fields related to target segment size and count within the ForceMergeSegmentView struct have been renamed for improved clarity and consistency.
  • Comprehensive Testing: New unit tests have been added to thoroughly validate the topology-aware segment calculation logic across various cluster configurations, ensuring robustness.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@mergify mergify bot added dco-passed DCO check passed. kind/bug Issues or changes related a bug labels Jan 6, 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-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

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

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a fix to use a user-provided target size for force merge compaction. It also adds logic to optimize the number of output segments for better loading parallelism on query nodes. The changes are well-tested. My main feedback is about the interaction between the user-provided target size and the parallelism optimization, where the latter can override the former in a way that might be surprising to the user. I've suggested a change to make this behavior more intuitive.

@codecov
Copy link

codecov bot commented Jan 6, 2026

Codecov Report

❌ Patch coverage is 65.67164% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.31%. Comparing base (e0d5039) to head (2675f9e).
⚠️ Report is 66 commits behind head on master.

Files with missing lines Patch % Lines
internal/datacoord/compaction_view_forcemerge.go 67.79% 17 Missing and 2 partials ⚠️
internal/datacoord/compaction_policy_forcemerge.go 57.14% 2 Missing and 1 partial ⚠️
internal/datacoord/compaction_trigger_v2.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #46835      +/-   ##
==========================================
+ Coverage   73.73%   76.31%   +2.57%     
==========================================
  Files        1426     2004     +578     
  Lines      229812   320921   +91109     
==========================================
+ Hits       169452   244901   +75449     
- Misses      52501    68149   +15648     
- Partials     7859     7871      +12     
Components Coverage Δ
Client 75.75% <ø> (ø)
Core 82.73% <ø> (∅)
Go 74.75% <65.67%> (+0.03%) ⬆️
Files with missing lines Coverage Δ
internal/datacoord/compaction_trigger_v2.go 55.37% <0.00%> (ø)
internal/datacoord/compaction_policy_forcemerge.go 46.19% <57.14%> (-0.19%) ⬇️
internal/datacoord/compaction_view_forcemerge.go 82.66% <67.79%> (-4.84%) ⬇️

... and 621 files with indirect coverage changes

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

@mergify
Copy link
Contributor

mergify bot commented Jan 8, 2026

@XuanYang-cn Thanks for your contribution. Please submit with DCO, see the contributing guide https://github.com/milvus-io/milvus/blob/master/CONTRIBUTING.md#developer-certificate-of-origin-dco.

@mergify mergify bot added needs-dco DCO is missing in this pull request. and removed dco-passed DCO check passed. labels Jan 8, 2026
@sre-ci-robot sre-ci-robot added size/XL Denotes a PR that changes 500-999 lines. and removed size/L Denotes a PR that changes 100-499 lines. labels Jan 8, 2026
@mergify mergify bot added dco-passed DCO check passed. and removed needs-dco DCO is missing in this pull request. labels Jan 8, 2026
@XuanYang-cn
Copy link
Contributor Author

/ci-rerun-e2e-default

@mergify mergify bot added the ci-passed label Jan 9, 2026
@tedxu
Copy link
Contributor

tedxu commented Jan 16, 2026

/lgtm
/approve

@sre-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tedxu, XuanYang-cn

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 merged commit 9b39d10 into milvus-io:master Jan 16, 2026
16 of 19 checks passed
@XuanYang-cn XuanYang-cn deleted the fix/46758 branch January 16, 2026 06:16
XuanYang-cn added a commit to XuanYang-cn/milvus that referenced this pull request Jan 16, 2026
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/bug Issues or changes related a bug lgtm size/XL Denotes a PR that changes 500-999 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants