Skip to content

fix(frontend): publish DUMP archives with create-only storage writes - #29808

Merged
mergify[bot] merged 13 commits into
matrixorigin:mainfrom
Lundomn:codex/issue-29759-dump-stage-race
Oct 21, 2026
Merged

mergify[bot] merged 13 commits into
matrixorigin:mainfrom
Lundomn:codex/issue-29759-dump-stage-race

Conversation

@Lundomn

@Lundomn Lundomn commented Oct 10, 2026 •

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 #29759.

What this PR does / why we need it:

Concurrent DUMPs to one Stage destination could replace another publisher's manifest, leaving a successful DUMP whose archive and LOAD data belonged to a different source table. Publish the manifest and READY through storage-level create-only writes: local/disk storage atomically links a complete temporary file without replacement; AWS S3 and explicitly configured MinIO use conditional single-object PUT. AWS capability admission recognizes S3 API hostname forms rather than the general AWS domain suffix; API Gateway, EC2, S3 website/control, and unknown endpoints fail before publication. A stale publisher cannot overwrite the winner after a SQL allocator binding is lost. Filesystem aliases use the native filesystem's name equivalence.

Unsupported providers/endpoints fail before source copying. Existing immutable object-copy and failed-fixture retention behavior is preserved. A cancelled DUMP after manifest publication leaves no READY; LOAD rejects the incomplete archive, and the client can retry at a new destination. SQL file-access authorization from the current base is preserved.

End-to-end coverage

TestTableDumpConcurrentPublication runs real MySQL DUMP/LOAD requests against two embedded CNs with two distinct two-row source tables and Stage/symlink aliases. Context-aware barriers synchronize the two writers before manifest publication. It asserts exactly one success, the winning manifest source, READY, and actual loaded row identities. It also cancels a query after manifest creation, checks incomplete LOAD and competing DUMP rejection, then verifies same-connection retry and LOAD results. Fault points and cluster resources are scoped to test cleanup.

Component regressions retain delayed/stale publication, allocator restart with binding validation, native case/symlink aliases, conditional PUT headers, unsupported endpoints, cancellation, and size limits. The committed allocator restart regression and SQL integration test remain separate. An additional isolated Linux experiment on the preceding head 18db1a01 restarts the real TN/allocator while both CN SQL publishers wait before manifest creation, then verifies a single winner, archive provenance and LOAD rows; it also passes the cancellation/incomplete archive/retry assertions. This experiment is retained separately from the committed test.

Validation

Head: 8912442aa35c401fe0238a318d8a77f07122c00c, rebased onto main a69f7e066deece1fd3efcb8cc1dad8d343936b60.

  • New endpoint regression failed on the prior suffix-only implementation and passed after the correction. Cases preserve default/global/regional/legacy/dualstack/FIPS S3 controls and reject API Gateway/EC2/China-region non-S3/website/control/suffix lookalikes. Rejected endpoints also exercise WriteExclusive without a client, asserting rejection before PUT.
  • Final-head fileservice normal/vet passed (27.732s), golangci-lint2.14.0 passed with0issues. Final four-package race/vet passed: frontend33.806s, fileservice45.997s, lockservice82.393s, multicn74.367s.
  • Exact head 8912442aa35c401fe0238a318d8a77f07122c00c: ALL CI, Connector/J, and Iceberg workflow completed successfully. All applicable checks passed, including UT Coverage and CI Required; 15 conditional/disabled checks are excluded, including the disabled Iceberg E2E. Mergify neutral checks are not counted as CI passes.
  • Retain the earlier two-line cross-CN fixture visibility correction before the protocol error assertion; prepared-DDL freshness checks remain unchanged, with no sleeps or retries.
  • Historical BM129 evidence on 18db1a01 versus 0fb05134: real TN/allocator-restart SQL experiment passed (6.095s), including winner provenance/LOAD and cancellation/retry. Resources were released and absence verified.
  • Historical matched DUMP/LOAD experiment on those revisions: 6 CPUs/16 GiB, two CNs, 10,000 rows with 128-byte repetitive payload, 5 warmups + 50 samples each. DUMP median 8.968 -> 8.073 ms; LOAD median 11.329 -> 11.716 ms. Every LOAD passed row-count/ID-sum/payload-length checks. One sequential run order and a small hot-cache workload do not establish general performance equivalence; these measurements were not rerun after the new rebase.

Limits and compatibility

HDFS, OSS, COS and unverified S3-compatible endpoints reject exclusive DUMP publication. Remote provider E2E and mixed-version writers remain unrun. BM129 use has resumed with user authorization; the additional fault and performance experiments passed for the explicitly recorded historical head/base. Unpatched/external writers that replace objects are outside the create-only contract. Historical benchmark numbers do not describe this revision; no zero-regression performance claim is made.

The changes were self-reviewed. Independent model review was not run under the user's explicit prohibition on delegation. Existing GitHub reviews remain visible; no review was dismissed or resolved by this update. New-head CI results will be tracked separately from local validation.

@Lundomn
Lundomn requested a review from XuPeng-SH as a code owner October 10, 2026 02:11
@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 added the kind/bug Something isn't working label Oct 10, 2026
@matrix-meow matrix-meow added the size/M Denotes a PR that changes [100,499] lines label Oct 10, 2026
@Lundomn
Lundomn marked this pull request as draft October 10, 2026 02:47
@Lundomn
Lundomn force-pushed the codex/issue-29759-dump-stage-race branch from b82a9d3 to 5df43ea Compare October 10, 2026 06:34
@Lundomn Lundomn changed the title fix(frontend): serialize table dump publication across CNs fix(frontend): serialize DUMP publication by destination path Oct 10, 2026
@Lundomn
Lundomn marked this pull request as ready for review October 10, 2026 06:34
@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 →

@XuPeng-SH

XuPeng-SH commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-xupeng · superseded

Commit: 8912442aa35c401fe0238a318d8a77f07122c00c

"interrupted"

@XuPeng-SH

XuPeng-SH commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: 8912442aa35c401fe0238a318d8a77f07122c00c

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH 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.

mo-bot review · mo-bot-local · review

Commit: 8912442aa35c401fe0238a318d8a77f07122c00c

Assessment: approve

Reviewed the complete 12-file delta and supplied discussions. Storage-level create-only publication restores archive ownership without a separate locking state machine. Stale-publisher, filesystem-alias, integration-test and AWS endpoint concerns are addressed. No actionable findings remain.

Model: gpt-6-astra / xhigh

Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1

Validation:

  • Traced DUMP authorization, Stage/provider selection, wrappers, immutable object copying, manifest/READY publication, retries, cancellation, cleanup and LOAD.

  • Reviewed deterministic component tests and the two-CN SQL test, including winning manifest provenance, actual loaded rows, incomplete-archive rejection and same-connection retry.

  • Reused frozen exact-head CI: 14 successful, 15 skipped and 2 neutral checks, including build, Ubuntu UT, SCA, coverage and multi-CN BVT.

  • Isolation preflight passed. An independent probe executing the exact production endpoint predicate passed 22 cases, including the previously admitted API Gateway and EC2 endpoints.

  • Exact head/base, clean source, supplied-patch equivalence and diff whitespace checks passed. Commands, source fingerprints, exit receipts and logs were reconciled in /home/xupeng/.local/state/mo-bot/jobs/9d89541007cee349e8791390/attempt-1/review-evidence.json.

Limitations:

  • No native product suites ran locally. local_validation is empty; individual CI logs and author execution receipts were not supplied. The local probe validates the endpoint predicate, not SQL or real-provider operations.

  • Remote-provider E2E, case-insensitive platform execution and mixed-version/external replacing writers were not independently validated. Unsupported providers intentionally fail closed.

  • No current-head performance measurements were verified. Local publication adds marker checks and link/unlink work; remote publication remains bounded at 64 MiB. Ordinary SQL gains no publication lock or metadata lookup.

  • The linked issue's full text was absent; its behavioral contract was assessed through the supplied PR description and review reproductions.

@XuPeng-SH
XuPeng-SH dismissed stale reviews from aptend and fengttt October 21, 2026 00:37

resolved

@mergify mergify Bot added the queued label Oct 21, 2026
@mergify

mergify Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-21 00:38 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ✅ Checks passed · in-place
  • ✅ Merged — 2026-10-21 04:20 UTC · at 04fe057bd73520cdf30754f79f66f6505060ad1f · squash

This pull request spent 3 hours 41 minutes 37 seconds in the queue, including 53 minutes 53 seconds running CI.

Required conditions to merge

This branch was previously deployed

1 inactive deployment
ci — 944c7a4e Deployed Oct 21, 2026 by mergify[bot]
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/L Denotes a PR that changes [500,999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Concurrent DUMP TABLE to the same Stage path can report success for the wrong source table

7 participants