fix: keep IndexNode ABI stable across Cardinal builds - #1786
Merged
foxspy merged 2 commits intoAug 21, 2026
Merged
Conversation
Signed-off-by: marcelo-cjl <marcelo.chen@zilliz.com>
Signed-off-by: marcelo-cjl <marcelo.chen@zilliz.com>
|
@marcelo-cjl 🔍 Important: PR Classification Needed! For efficient project management and a seamless review process, it's essential to classify your PR correctly. Here's how:
For any PR outside the kind/improvement category, ensure you link to the associated issue using the format: “issue: #”. Thanks for your efforts and contribution to the community!. |
Collaborator
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: foxspy, marcelo-cjl The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This was referenced Aug 21, 2026
sre-ci-robot
pushed a commit
to milvus-io/milvus
that referenced
this pull request
Aug 22, 2026
issue: #52723 issue: #52724 issue: #52725 ## What - Update Knowhere from `d85f7080` to `d7cfd888`. - Pick up zilliztech/knowhere#1786, which keeps `IndexNode::BuildAsync()` in the public vtable for both Cardinal and non-Cardinal builds. - Pick up the Cardinal v1 bump to `v2.5.111`, including its nullable-index fix. ## Why In a Cardinal-enabled Milvus build, Knowhere translation units define `KNOWHERE_WITH_CARDINAL`, while Milvus core consumers of the same public header do not. The previous conditional `BuildAsync()` declaration therefore gave the two DSOs different `IndexNode` vtable layouts. Calls intended for `GetIdMap()` could dispatch to `Count()` instead and interpret its integer return as an `IdMap&`, causing the SIGSEGVs reported in #52723, #52724, and #52725. Knowhere `d7cfd888` makes the public vtable independent of that feature macro. ## Validation - No new local build or test was run for this dependency-pin-only change; validation is delegated to Milvus PR CI. - The underlying Knowhere fix passed Knowhere CI and a prior Milvus Cardinal A/B reproduction: the affected ordinary HNSW test changed from SIGSEGV/exit 139 on the old pin to 1/1 passed with the fix. Signed-off-by: marcelo-cjl <marcelo.chen@zilliz.com>
sre-ci-robot
pushed a commit
to milvus-io/milvus
that referenced
this pull request
Aug 22, 2026
pr: #52754 issue: #52723 issue: #52724 issue: #52725 Cherry-pick from master. ## What - Update Knowhere from `d85f7080` to `d7cfd888`. - Pick up zilliztech/knowhere#1786, which keeps `IndexNode::BuildAsync()` in the public vtable for both Cardinal and non-Cardinal builds. - Pick up the Cardinal v1 bump to `v2.5.111`, including its nullable-index fix. ## Why In a Cardinal-enabled Milvus build, Knowhere translation units define `KNOWHERE_WITH_CARDINAL`, while Milvus core consumers of the same public header do not. The previous conditional `BuildAsync()` declaration therefore gave the two DSOs different `IndexNode` vtable layouts. Calls intended for `GetIdMap()` could dispatch to `Count()` instead and interpret its integer return as an `IdMap&`, causing the SIGSEGVs reported in #52723, #52724, and #52725. Knowhere `d7cfd888` makes the public vtable independent of that feature macro. ## Validation - No new local build or test was run for this dependency-pin-only cherry-pick; validation is delegated to Milvus PR CI. - The underlying Knowhere fix passed Knowhere CI and a prior Milvus 3.0 Cardinal A/B reproduction: the affected ordinary HNSW test changed from SIGSEGV/exit 139 on the old pin to 1/1 passed with the fix. Signed-off-by: marcelo-cjl <marcelo.chen@zilliz.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
issue: #1687
What
IndexNode::BuildAsync()unconditionally soKNOWHERE_WITH_CARDINALno longer changes the publicIndexNodevtable layout.IndexNode::BuildAsync()implementation.v2.5.110tov2.5.111; the new tag points to Cardinal merge commit84968dafrom zilliztech/cardinal#916.Why
KNOWHERE_WITH_CARDINALis currently defined inside the embedded Knowhere CMake directory. Knowhere/Cardinal translation units see the macro, while an external consumer can include the same public header without it.Because
BuildAsync()was conditionally present near the start ofIndexNode, every later virtual slot had two possible layouts. A consumer-side inlineGetIdMap()call could therefore dispatch the Cardinal object'sCount()slot instead, interpreting the integer return value as anIdMap&and crashing on a null dereference. This was observed in milvus-io/milvus#52724.Public feature macros must not alter a cross-library base-class vtable. Keeping the virtual method present in both builds preserves one layout; non-Cardinal nodes use the existing default implementation, which delegates to
Build().Commits
fix: keep IndexNode BuildAsync in public vtablefix: bump Cardinal v1 to v2.5.111Validation
Test index nodepassed (49 assertions / 1 case), including the defaultBuildAsync()call.v2.5.111@84968da, v2v3.0.5@cf22bdf.KNOWHERE_WITH_CARDINALagainst the Cardinal-enabled fixedlibknowhereand calledGetIdMap()successfully.3e402910fA/B test withindex_engine=cardinal:d85f7080: ordinaryIndexing.HnswEmbListEmptyNullableUsesLogicalIdscrashed inCardinalIndexNode::Count()with SIGSEGV / exit 139;The Milvus fixed build deliberately retained the real compile-definition split (
libknowheremacro ON, MilvusVectorDiskIndex.cppmacro OFF). Passing under that split confirms the fix stabilizes the public vtable rather than masking the issue by changing consumer flags.