Skip to content

enhance: [3.0] backport nullable Struct Array bulk writer support - #3934

Merged
sre-ci-robot merged 2 commits into
milvus-io:3.0from
zhuwenxing:backport-struct-bulk-writer-3.0-1111
Nov 11, 2026
Merged

sre-ci-robot merged 2 commits into
milvus-io:3.0from
zhuwenxing:backport-struct-bulk-writer-3.0-1111

Conversation

@zhuwenxing

@zhuwenxing zhuwenxing commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Backport #3892 to 3.0 so Struct Array bulk imports can use the nullable child support already backported in #3927.

  • Accept nullable or omitted scalar, vector and nested Array children, preserve nullable array elements and logical element positions, and ignore undeclared Struct keys.
  • Serialize JSON, JSONL, CSV and Parquet consistently, including nullability at each Arrow schema layer; reject Struct schemas for NumPy output before creating files.
  • Backport the corresponding unit and integration tests without changing the 3.0 protobuf dependency or release line. Adapt the last-original-child drop scenario to the 3.0 guard: require code 1100, verify the retained schema, then compare imported values with inserts.

Original PR: #3892
Original merge commit: 1e479299f8af8b6c5e9f3433774cee470f62c7c2
Related Milvus test backport: milvus-io/milvus#55243

Validation

  • Cherry-pick onto PyMilvus 3.0 commit c7e1850531370b73256b94c4ce762a9ed1e27ce1; all four production files and the unit-test file match the original merge commit. The integration test has one branch-specific schema-guard adaptation.
  • make coverage: 5,793 passed, 1 skipped on Python 3.12.12.
  • make lint: passed (Black and Ruff from the repository lockfile).
  • git diff --check: passed.
  • Milvus 3.0 commit 6d4305e57c2: all 12 JSON/JSONL/CSV/Parquet import variants across unchanged, added and dropped child schemas passed; queries and vector searches match inserted controls.
  • The adapted last-original-child rejection/Parquet import case passed, as did both NumPy constructor rejection cases: 15 selected checks passed across the completed invocations.
  • The initial gateway run failed on HTTP routing; direct port forwarding resolved those infrastructure errors. The unadapted all-original-children-drop case failed with the documented 3.0 code 1100; the revised case asserts that guard and validates exact post-rejection import data. These original failures were retained and are not counted as passes.
  • The CI Python 3.9/3.14 and Linux/Windows matrix has not been run locally.

The original PR's limitations remain: this retains pandas Parquet serialization and does not resolve NaN handling, nullable INT64 precision, or background flush error propagation.

pr: #3892

Backport master PR milvus-io#3892 (1e47929).

pr: milvus-io#3892
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
@codecov

codecov Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.43590% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.86%. Comparing base (c7e1850) to head (42d3601).
⚠️ Report is 1 commits behind head on 3.0.

Files with missing lines Patch % Lines
pymilvus/bulk_writer/bulk_writer.py 96.96% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              3.0    #3934      +/-   ##
==========================================
+ Coverage   94.78%   94.86%   +0.08%     
==========================================
  Files          81       81              
  Lines       17371    17392      +21     
==========================================
+ Hits        16465    16499      +34     
+ Misses        906      893      -13     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

@zhuwenxing
zhuwenxing marked this pull request as ready for review November 11, 2026 06:40
@mergify mergify Bot added the ci-passed label Nov 11, 2026
@mergify

mergify Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

This pull request is merged.

Expect dropping the last original Struct child to fail with code 1100,
then verify Parquet import preserves the retained child, added-child
NULLs, parent NULLs and empty arrays.

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
@mergify mergify Bot added ci-passed and removed ci-passed labels Nov 11, 2026

@XuanYang-cn XuanYang-cn left a comment

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.

/lgtm

@sre-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

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

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

zhuwenxing added a commit to zhuwenxing/milvus that referenced this pull request Nov 11, 2026
Sync master PR milvus-io#55237 through 51c51ca, including consolidated
scenario modules, concurrent read validation, MATCH predicates,
nullable vector mutation and compaction, and bulk writer imports.

Retain 3.0 schema retry handling, the scoped refresh-index expected
failure, and the published 3.0 SDK dependency. Bulk writer E2E needs
the SDK backport in milvus-io/pymilvus#3934 before a new RC is pinned.

pr: milvus-io#55237
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
@sre-ci-robot
sre-ci-robot merged commit 889e904 into milvus-io:3.0 Nov 11, 2026
14 checks passed
zhuwenxing added a commit to zhuwenxing/milvus that referenced this pull request Nov 11, 2026
Use Test PyPI pymilvus 3.0.4rc1 from 3.0 merge commit 889e904a8a8a,
which includes milvus-io/pymilvus#3934. All 12 nullable import
combinations and three REST import-rejection cases passed with the
published package.

pr: milvus-io#55237
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
sre-ci-robot pushed a commit to milvus-io/milvus that referenced this pull request Nov 12, 2026
## Summary

Backport the Struct Array E2E coverage from #55237 to `3.0`,
synchronized through master PR commit `51c51caeda`.

- Consolidate Python coverage into schema, DML, query, search, import
and concurrency scenario modules with shared schema-driven generators
and assertions.
- Include the follow-up concurrency, MATCH query/search, PATH_REPLACE,
nullable-vector compaction and raw/LocalBulkWriter/RemoteBulkWriter
import coverage.
- Consolidate REST contract cases and shared data generation. Keep the
existing Go SDK coverage.
- Remove the C++ unit-test additions and standalone regression
documentation/scripts, matching the current E2E-only master PR scope.
- Preserve the 3.0-specific retriable schema rejection handling: prove
non-mutation before bounded retries, and fail non-retryable rejections.
Preserve the scoped #54594 refresh-index and zilliztech/knowhere#1956
score-budget expectations. Keep the 3.0 NumPy rejection at admission
(code 2100), including no-job/no-mutation checks.

- Mark the eight confirmed 3.0 concurrency failures with parameter-level
non-strict xfails linked to #55024 or #55411, restricted to verified
issue signatures.

## SDK dependency

Both Python and REST suites now pin Test PyPI `pymilvus==3.0.4rc1`
(including the Python bulk-writer extra). This is the published package
for PyMilvus 3.0 merge commit
`889e904a8a8a6ed668cff1830900286a00375270`, which merged
milvus-io/pymilvus#3934. Provenance is confirmed by the successful
[publish
workflow](https://github.com/milvus-io/pymilvus/actions/runs/42975853739).
The SDK release dependency is resolved.

## Validation

- Latest non-strict follow-up on Milvus `6d4305e57c2` / Test PyPI
PyMilvus `3.0.4rc1`: **1 PASS, 4 XFAIL, 4 XPASS** across all nine
selected schema/mixed-history parameters (141.35 seconds). The runner
succeeded. The four XFAILs still represent unresolved known product
bugs; XPASS only means the race was not observed in that run. Existing
overlap, data/reload and uncertain-write checks were retained.

- Earlier validation with `strict=True` produced **4 XFAIL and 2
XPASS(strict)** for the six schema parameters and **2 XPASS(strict) and
1 PASS** for the mixed histories. These timing-dependent clean runs made
that policy unsuitable for temporary quarantine. The non-strict policy
and latest results below supersede those failing XPASS verdicts; the
original observations remain recorded.
- Xfail guards replay both retained mixed-history failures and reject
unrelated assertions, wrong field IDs/codes/epochs, incorrect reads,
reload failures, uncertain writes and missing overlap: **12 guard checks
passed**. Current verdict probes confirm known errors become XFAIL,
clean marked tests become non-failing XPASS, and unrelated errors still
fail. `--runxfail` restores normal failures for fix verification.

- Published-RC follow-up: Test PyPI `pymilvus==3.0.4rc1` installed
successfully; all 97 runtime files match the locally validated SDK
backport wheel. With the published package, all **12
raw/LocalBulkWriter/RemoteBulkWriter import combinations passed**, and
all **3 REST import-rejection cases passed** via Milvus Dev CLI on the
same 3.0 deployment. This resolves the SDK release dependency, not the
concurrency failures listed below.

- All 73 previously added Python test methods remain present after
consolidation.
- Six primary scenario modules collect 590 instances; the four REST
selection files collect 44 instances.
- Ruff 0.15.11 lint/format and Python parsing pass for all 20 changed
Python files.
- Go SDK package lint passes with golangci-lint 2.11.3; both PR Go files
pass gci, gofmt, gofumpt and goimports independently.
- Added-source Apache headers and `git diff --check` pass. The
configured license workflow selects internal Go files; none remain
changed in this PR.
- Focused Python E2E on Milvus 3.0 commit `6d4305e57c2` with local
validation wheel `3.0.3rc14+cp3892.0b79ab24`: **126 passed, 5 failed, 1
expected failure**, 132 selected cases, 676.8 seconds. This covers the
recent imports, MATCH query/search, PATH_REPLACE, FLAT/HNSW compaction,
all concurrency cases and the refresh regression. All 12
raw/LocalBulkWriter/RemoteBulkWriter format combinations passed.
- REST E2E via Milvus Dev CLI: **44 passed** after the NumPy admission
expectation was adapted (26 previously passed unaffected cases plus 18
in the affected/remaining selection). The original NumPy expectation
failed; it is not counted as a pass.
- The existing #54594 refresh regression retains its scoped
field-not-loaded signature. The concurrency follow-up below adds eight
parameter-level non-strict xfails; no skips were added.
- The Milvus pod had zero restarts. Timing journals confirm real
read/write and DDL/read/write overlap in all three mixed histories.
- This is a focused run, not a full 590-case pass. Earlier broad
execution results describe the previous PR revision. Initial
gateway/port-routing failures are retained separately from this
completed run.

## Known concurrency issues

Eight confirmed failing parameter instances now use `xfail(strict=False,
raises=ConcurrentSchemaReadFailure)`. These product races are
intermittent: a clean run is recorded as XPASS without failing the job,
and is not evidence of a fix. Only verified issue signatures qualify for
XFAIL; unrelated exceptions and correctness failures remain ordinary
failures:

-
`test_add_drop_readd_child_overlaps_queries_and_preserves_schema_snapshots[query-scalar]`,
`[query-nested]` and `[query-vector]`: code 2000 / segcore code 2001
(`Cannot find field with field_id`) while reading across child DDL,
tracked by #55024.
- The same case with `[search-scalar]`, `[search-nested]` and
`[search-vector]`: a stable projection returns code 1100 (`field
clips[changing] not exist`), tracked by #55411, or the dropped-field
segcore 2001 tracked by #55024. Both signatures were reproduced during
this follow-up.
-
`test_concurrent_reads_upserts_deletes_preserve_acknowledged_rows[smoke]`
and `[seed41]`: query failures with code 2000 / segcore code 2001 during
child removal, tracked by #55024. `[seed109]` remains unmarked.

The schema-snapshot cases finish their data, fresh-field-ID and reload
checks before raising the scoped failure. Mixed-history classification
requires the dropped field ID, read-only errors in the drop epoch,
successful reload reconciliation, no uncertain writes, and actual
concurrency overlap. These product bugs remain unresolved; xfail markers
do not establish a green full-regression result.

This quarantine is temporary and tracked by #55024/#55411. Retain
per-run XFAIL/XPASS counts and original error journals; do not replace
failures with retry-to-green results. Revisit the marks when a
fix/backport is available, verify the fixed build with `--runxfail` and
actual DDL/read overlap plus data/reload checks, then remove them. A
single XPASS is insufficient.

pr: #55237

---------

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants