Skip to content

[4.2-dev] Fix ONNX Runtime downloads when the primary endpoint fails - #33408

Merged
XuPeng-SH merged 2 commits into
matrixorigin:4.2-devfrom
XuPeng-SH:codex/42-onnx-download-fallback
Nov 27, 2026
Merged

XuPeng-SH merged 2 commits into
matrixorigin:4.2-devfrom
XuPeng-SH:codex/42-onnx-download-fallback

Conversation

@XuPeng-SH

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Closes #33407

What this PR does / why we need it:

CI on 4.2-dev fails before the tests run when the primary ONNX Runtime URL returns HTTP 504. Reuse the LFS media endpoint that recovered a main build. The shared downloader retains its existing per-endpoint retry budget and verifies the same pinned SHA256 before installing the file. The backup is used after HTTP, timeout, or receive errors. The local proxy reported its HTTP 504 as curl exit 56.

Validation

  • Ran make -C thirdparties test-download for HTTP and timeout recovery, proxy receive errors, both curl retry engines, and rejection of a corrupt or non-HTTPS fallback.
  • Ran the Linux x64 ONNX Runtime target from an empty install directory. The primary URL returned HTTP 504 throughout the default retry budget. The fallback installed the ELF x86-64 library with the configured SHA256.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@mergify

mergify Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@XuPeng-SH
XuPeng-SH merged commit c35f22e into matrixorigin:4.2-dev Nov 27, 2026
21 of 27 checks passed
@XuPeng-SH
XuPeng-SH deleted the codex/42-onnx-download-fallback branch November 27, 2026 18:50
XuPeng-SH added a commit that referenced this pull request Nov 28, 2026
…ned objects (#33406)

## What type of PR is this?

- [ ] API-change
- [x] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR fixes:

Fixes #33079 on `4.2-dev`. The corresponding main fix is #33405.

## What this PR does / why we need it:

Rewriting a CLONE object in the transaction that created the clone used
to apply only the pending DELETE offsets. Inherited tombstones still
pointed to old RowIDs, allowing deleted rows copied into a replacement
to become visible.

Stream the union of the destination table's live tombstones and pending
offsets through each rewritten block. Existing zone maps select
candidate tombstone files. Reuse a block-sized scratch slice per worker
and the existing bounded object registry for uploads. Once metadata is
published in the workspace, it owns the replacement. The originals
remain live until every rewrite succeeds.

The 4.2 workspace can have applied maintenance to earlier statements
when a rewrite fails. Use the existing full transaction rollback path in
that case. Preserve the storage error and old workspace marks until
rollback. The object registry retains unadopted uploads and retries
transient cleanup failures.

## Review follow-up

The regression now uses the serialized `pkg/embed.RunBaseClusterTests`
fixture. It connects directly to two distinct CNs over MySQL, flushes
the source data and source delete, and creates and rewrites the clone in
one transaction. After COMMIT, the test waits for each CN to apply the
writer's commit and compares the complete ordered `(id, a)` rows in both
tables on both CNs. Cleanup rolls back the writer and drops the test
database on a separate session before the fixture unlocks. [Shared
fixture
review](#33406 (review))
· [Cross-CN visibility
review](#33406 (review))

## Validation on `4de762f6107031e5def4ec53b0cdea15462d946a`

- Base `4.2-dev` is `78fe31d619bd88b0e7638d6178fa904125b23533`. Only the
embedded regression changed relative to `fb76588`.
- Built the exact `pkg/embed` test target with `-tags matrixone_test`.
`TestCloneRewriteKeepsPersistedDeletesAcrossCNs` and
`TestCloneDatabaseForeignKeySourceInventory` passed five repetitions in
the same process. Five separate pre-COMMIT interruption probes also
verified that both CNs saw no remaining test database after rollback and
cleanup. Work returned `EPERM` for Unix socket creation, so the local
embedded test runs selected the TCP listener in a temporary startup
overlay.
- Ran the checked-in `clone_delete_ownership.sql` and `.result` with
`mo-tester` at `309a0ca650e0c55e90292767fd61e4976818d66d` in normal
comparison mode. All 68 statements passed with zero ignored.
- The existing `TestWorkspaceRewriteTombstoneOffsets` and
`TestCloneRewriteFailureRequiresFullRollback` each passed five
repetitions on this source tree. Both injected failure paths retained
the originals, reclaimed replacement objects, and exercised reclamation
retry for the ambiguous upload.
- `git diff --check` passed. [Hosted CI on this
head](https://github.com/matrixorigin/matrixone/actions/runs/46066246766)
is pending.

## Previous validation on `fb76588`

- The original two-CN integration fixture passed four executions,
including a repeat after fetching its published source tree. The
rollback and reclamation tests each passed ten times. The SQL fixture
passed 68 statements with zero ignored using ordinary `mo-tester`
comparison.
- The shared build, ARM64 SCA, x86 UT, proxy and pessimistic Compose
BVT, Shanghai OSS/COS, and Coverage Group 0 passed on this previous
head. Coverage Group 1 was cancelled. [Previous-head
CI](https://github.com/matrixorigin/matrixone/actions/runs/46057272242)
· [Shanghai coverage
artifact](https://github.com/matrixorigin/matrixone/actions/runs/46057272242/artifacts/15226923362)

## Earlier hosted CI

- The ARM64 SCA setup, x86 UT setup, shared build, Shanghai OSS/COS
setup, proxy Compose launch, and pessimistic Compose launch each stopped
after repeated HTTP 504 responses downloading ONNX Runtime. The failures
occurred before analysis or test execution in those jobs. The Compose
coverage steps also lacked the outputs of the failed launch. The new
base includes the ONNX download fallback from #33408. [Previous CI
run](https://github.com/matrixorigin/matrixone/actions/runs/46049955761)
- Coverage Group 1's selector received HTTP 403 reading and revoking
worker metadata. The worker also hit a separate assertion in
`TestIvfCreateStart_Error/Invalid_params_json`, and the coverage
aggregate stopped because a required profile was unavailable. The
failing test and Sonic dependency match the base. A local decoder probe
with the same malformed input returned `Syntax error` on Go 1.26.4 and
`unexpected EOF` when Go 1.27.1, the worker version, selected Sonic's
standard-library fallback.
[Selector](https://github.com/matrixorigin/matrixone/actions/runs/46049955761/job/140678968449)
·
[Worker](https://github.com/matrixorigin/matrixone/actions/runs/46050113266/job/140679041824)
· [Coverage
aggregate](https://github.com/matrixorigin/matrixone/actions/runs/46049955761/job/140699827183)

## Earlier validation on `3fbe98e`

- On two CNs, all 57 rows in the clone ownership fixture and 20 more
transaction observations matched, including source and sibling
isolation, a same-transaction source DELETE, rollback and an empty
replacement.
- The 32,768-row multi-block probe resurrected two rows on the base and
zero on the candidate. In 18 timed samples per case, including actual
rewrite at the next statement boundary, median latency was 0.651 → 0.569
ms for ordinary DELETE, 23.759 → 21.282 ms for a clean clone and 23.727
→ 21.526 ms for a clone with inherited tombstones. These timings are
from the same local setup.
- Failure injection covered a missing tombstone and an upload that wrote
its file but returned an error. Full rollback preserved the original
objects and reclaimed the recorded replacement. The registry reclaimed
the unadopted upload after an injected delete failure.
- The full `disttae` package passed under `-race`. Incremental SCA
reported zero issues. Hosted CI runs separately.

---------

Co-authored-by: Codex <[email protected]>
mergify Bot pushed a commit that referenced this pull request Nov 29, 2026
## What type of PR is this?

- [x] Test and CI

## Which issue(s) this PR fixes:

Related to #33416, #26664 and #33408.

## What this PR does / why we need it:

Backport the verified local ONNX Runtime path from #27325 to `4.2-dev`. Use the published Go 1.26.4 native builder image. The existing downloader owns validation and atomic installation for installed, preloaded and HTTPS sources. A warm hit restores mode `0644`. A missing cache invokes the existing HTTPS and LFS fallback. A corrupt preload is rejected without replacing the destination.

| Linux architecture | Local ONNX library | Additional compressed image layer |
| --- | ---: | ---: |
| amd64 | 23,023,576 bytes | 8,603,979 bytes |
| arm64 | 19,543,040 bytes | 7,720,445 bytes |

Compared with the current base image, only the additional layer needs to be pulled when the previous layers are cached. The warm ONNX build has zero network transfer.

The regular Docker images use the native base directly. Shared Build uses the existing image published from `main`. [#33427](#33427) exports its already-installed ONNX Runtime at the same versioned path with a symbolic link, so Shared Build can reuse the library even when its complete third-party fingerprint differs. The library is identical on both branches. Shared Build hits start with the next successful image publication containing that change.

Validated with the published Linux libraries and external networking disabled. On amd64, cache hits with only `sha256sum` and no curl succeeded and installed mode `0600` was repaired. A corrupt preload left the original destination intact. A loopback HTTPS primary 404 reached the fallback and produced a byte-identical library. On arm64 the published library and the downloader regression suite passed.

Synced to the latest `4.2-dev` and reran the Linux downloader suite. The same network-disabled amd64 image fixture verified the link exported by #33427 with the real ONNX library on both branches. Both branches passed the offline arm64 test and the loopback HTTPS primary-404 and fallback check.

Approved-by: fengttt <[email protected]>

This branch was successfully deployed

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

Labels

kind/bug Something isn't working kind/test-ci size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants