Skip to content

[Bug]: physical backup provider copy reports EOF after successfully copying an empty MinIO object #32413

Closed

Description

@slyunnn

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

main

Commit ID

e2459cc55f4b514893e19732743460bc5f16d552 — docs: design early runtime filtering and dictionary vector execution (#32380)

Other Environment Information

  • macOS darwin/arm64, 16 GiB memory, Go 1.27.1.
  • Real MinIO built from official RELEASE.2025-09-07T16-13-09Z sources with the MatrixOne-pinned minio-go/v7 dependency.
  • Two isolated test buckets on the same MinIO server. FileService caches disabled.
  • Reproduced with an external Go test overlay. MatrixOne tracked source files were unchanged.

Actual Behavior

backup.CopyFileWithRetry returns checksum copied backup object: EOF after successfully provider-copying an existing, valid, empty S3/MinIO object. The destination object is already present and StatFile reports Size=0, but the backup copier reports failure and returns no checksum.

The equivalent 1-byte provider copy succeeds. Local DISK and DISK-V2 empty-source stream copies also succeed, so the failing case specifically exercises the provider-copy checksum phase.

Observed output from the direct consumer test

size=0 checksum= copy_err=checksum copied backup object: EOF target_stat=&{object false 0} target_err=<nil>
size=1 checksum=8e35c2cd3bf6641bdb0e2050b76932cbb2e6034a0ddacc1d9bea82a6ba57f7cf copy_err=<nil> target_stat=&{object false 1} target_err=<nil>

Expected Behavior

A successful provider copy of a valid empty object should return success with the SHA-256 of empty content. Its checksum phase should handle the FileService empty-object read contract consistently with stream copying.

Steps to Reproduce

  1. Start a real MinIO server and create two disposable buckets with the same endpoint and credentials.
  2. Construct a source and destination using fileservice.NewS3FS, ObjectStorageArguments.IsMinio=true and fileservice.DisabledCacheConfig. Select different buckets so the target object is initially absent.
  3. Write an existing empty object to the source FileService.
  4. Invoke the public backup copier and inspect the target. The core calls are shown below. source and target are the two FileServices from step 2.
err := source.Write(ctx, fileservice.IOVector{
    FilePath: "object",
    Entries: []fileservice.IOEntry{{
        Size: 0,
        ReaderForWrite: bytes.NewReader(nil),
    }},
})
require.NoError(t, err)

sourceStat, err := source.StatFile(ctx, "object")
require.NoError(t, err)
require.Zero(t, sourceStat.Size)

checksum, copyErr := backup.CopyFileWithRetry(ctx, source, target, "object", "")
targetStat, statErr := target.StatFile(ctx, "object")
require.NoError(t, statErr)
require.Zero(t, targetStat.Size)
require.NoError(t, copyErr) // fails with "checksum copied backup object: EOF"
require.Equal(t, sha256.Sum256(nil), [32]byte(checksum))

Repeat with a newly created source and target bucket and Size=1, using a single byte q. That control passes and yields the checksum shown above.

Additional information

Discovered while independently verifying #32077. Its bounded stream-upload allocation fix passed the real-MinIO checks. This provider-copy behavior predates that fix. git blame attributes the provider-copy checksum phase to 2dd3f83d9e330852daa789253178463f3173c202 (fix(backup): avoid MinIO copy connection deadlock (#26291)).

pkg/backup/tae.go invokes checksumFile after successful provider copy. For an empty object, the FileService Read call returns io.EOF, which currently becomes a checksum error even though the copied object exists. The regression should cover the public CopyFileWithRetry API, provider success, destination visibility, empty-content checksum and a non-empty control.

Activity

  1. added
    kind/bug
    on Nov 9, 2026
  2. added theissue type on Nov 9, 2026
  3. added this to the MO-202611 milestone on Nov 9, 2026
  4. assigned and unassigned on Nov 9, 2026
  5. XuPeng-SH commented on Nov 10, 2026

    @XuPeng-SH
    Contributor

    QA 交接:修复已合入 main,待验收

    关联 PR #32434 已于 2026-11-10 02:25 UTC 合入 main,merge SHA 2f6fcc772175d0c0e80ad97aac6d44360c513347,最终 head 48a8abca4b5a2de4a9d8d3bb16ce03dc30f3032e。

    修复范围:provider copy 成功后的目标对象 checksum 遇到 EOF 时,只有同一文件系统、同名对象 StatFile 确认存在且大小为 0,并且无取消或 Close 错误,才返回空内容 SHA-256。非空、缺失、Stat/Close 错误及取消不应被当作空对象成功。保留 provider-copy 优先级及成功 copy 不重复执行的原有语义。

    已有证据(远端记录,本轮未本地实测):PR 作者报告 15 项 focused CGo 回归、manifest/sidecar 读回及 7 项真实 MinIO copy 用例通过;早期 review 在 99a88c256d 报告 72 项 owning-package normal tests 通过。后续 0c5839dda8 review 未重新运行 Go 测试,明确复用有来源的历史结果;Mergify 合并记录显示 CI Required 成功。这些证据不等于本轮复现或 QA 验收通过。

    建议 QA 在合入版本重跑本 issue 的真实 MinIO 空对象和 1-byte 对照,检查目标可见性及完整 32-byte SHA-256;补充 missing/nonempty、Stat/Close 错误、取消与重试次数边界,并验证 manifest/sidecar。作者 MinIO 版本与原报告版本不同(2023-11-01 与 2025-09-07),原报告版本建议覆盖;完整物理备份/恢复及空 TAE 对象恢复尚无充分验证记录。当前完整 issue 评论及修复讨论未见适用于该合入修复的已验证反例或未完成开发 follow-up,交 Ariznawlll 验证,issue 保持 open。

  6. slyunnn commented on Nov 11, 2026

    @slyunnn
    Author

    Regression and extended verification for #32413 (2026-11-11)

    Per the QA hand-off (2026-11-10), the merged fix for #32413 was re-verified on the latest origin/main: the provider-copy checksum phase now returns success with the full 32-byte SHA-256 for real empty MinIO objects, and the pre-fix failure class no longer occurs on the same MinIO release the issue was originally reported against. Result: Fixed.

    Verification Environment

    • Maintenance branch / remote commit: main at 553e16f52b — fix(parser): support quoted wildcards in DESCRIBE shortcuts (#32339); git merge-base confirms it contains fix merge 2f6fcc772175d0c0e80ad97aac6d44360c513347 (PR fix(backup): verify empty provider-copied objects without EOF failure #32434, merged 2026-11-10 02:25 UTC). Single-branch verification: this is a main issue; 4.2-dev was not verified and no 4.2-dev result is claimed.
    • Associated fix: PR fix(backup): verify empty provider-copied objects without EOF failure #32434, fix(backup): verify empty provider-copied objects without EOF failure. Direction: when the post-copy checksum Read of the copied destination returns io.EOF, the empty-content SHA-256 is produced only when the same fileservice and the same object name StatFile-prove an existing size-0 object and no context cancellation, Read cancellation or Close error occurred; a missing or non-empty object, a StatFile failure, a Close failure and any cancellation keep their original failure. Provider-copy precedence (server-side copy before source readers are opened) and the no-repeat of a successful provider copy are pre-existing behaviour now locked by the merged tests.
    • Binary / topology: local build from that exact main tip, go1.27.1 darwin/arm64; -version reports Git commit ID 553e16f52b, buildtime 1794380911; binary SHA-256 33c50723cc82728d59a58d03ba7e879850db0493584d168eab998d79cfb887bc. Deployed as a fresh-data single-version 2 CN / 1 TN / 1 LogService + Proxy; Proxy 6001, CN1 16001, CN2 16002 were all connected and answered git_version() = 553e16f52b (3/3 identity consistent). Endpoints carried connectivity/identity and service-health checks only — per the standard caveat those are NOT counted as endpoint regression: this defect and its reproduction live in the physical-backup copy/checksum layer, not in any SQL endpoint path. The service was stopped and all three ports released afterwards.
    • Real MinIO: official RELEASE.2025-09-07T16-13-09Z darwin-arm64 binary — the exact release the issue was reported against — SHA-256 7c3b3039b76e55a1b80935848ed83998d5e8d317374f87851f46a019ff5c0aa4 verified against the published checksum; run locally with an isolated throwaway bucket pair per attempt and FileService caches disabled (DisabledCacheConfig). This closes the hand-off's version note: the PR author's earlier evidence used 2023-11-01; the original report's 2025-09-07 is now covered directly.
    • Client / method: no SQL protocol is involved. The reproduction and matrix follow the issue's own methodology — an untracked external Go test overlay inside pkg/backup (tracked MatrixOne sources unchanged) driving the public backup.CopyFileWithRetry and backup.CopyFile APIs through real fileservice MinIO/S3 backends, plus a recording ObjectCopier wrapper proving the server-side provider CopyObject fired (provider_copy=true), plus the merged in-repo focused suite through the repository CGo test harness.

    What Was Covered

    • OK — original reproduction, empty object (size 0) via CopyFileWithRetry: the provider copy fires, the copy returns success, the checksum is the full 32-byte empty digest e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855, and the destination object is visible with size 0 — the reported checksum copied backup object: EOF signature no longer occurs.
    • OK — empty object via the second public API CopyFile: same success, same empty digest, destination visible at size 0.
    • OK — one-byte control via both public APIs: success, checksum 559aead08264d5795d3909718cdd05abd49572e84fe55590eef31a88a08fdffd, destination size 1.
    • OK — non-empty control (8192-byte patterned object) via CopyFileWithRetry: success, checksum 25df2449b2e5a35fea14e02a7158e283801a1069c9f84631b9a9dacb2f809a7f, destination size 8192 — ordinary copies are unaffected by the fix.
    • OK — repeat copy of the empty object: a second CopyFileWithRetry run stays successful with the same empty digest and an independently verified destination, consistent with the retry/no-repeat contract.
    • OK — missing source: CopyFileWithRetry for a never-existing object fails with The specified key does not exist. and creates no destination object — a missing object is not converted into empty-object success.
    • OK — provider-copy proof: in every provider-oriented case the recording cataloger observed the real MinIO server-side CopyObject (provider_copy=true), so the exercised path is the production provider-copy branch, not the streaming fallback.
    • OK — merged in-repo focused suite (pkg/backup, 15/15 top-level tests with their full subtest set; 96 run/pass log entries, 0 failures, no unexpected skips) on the same tip: empty-object proof and attached-reader handling (TestChecksumFileReadEOFProvesEmptyObject, TestChecksumFileReadEOFAttachedReader), failure-cause precedence for cancellation/Stat/Close (TestChecksumFileReadEOFCausePrecedence, TestCopyFileWithRetryProviderStatFailures, TestCopyFileWithRetryEOFWithNonEmptyTarget), provider precedence and single read fallback (TestCopyFileUsesProviderCopyBeforeOpeningSourceReaders, TestCopyFileFallbackReadsSourceOnce), no-repeat of a successful provider copy (TestCopyFileWithRetryDoesNotRepeatSuccessfulProviderCopy), and MinIO size-policy handling (TestBackupMinioSizePolicy); backup manifest and checksum-sidecar readback are exercised through the actual saveTaeFilesList and sidecar helpers as recorded in the PR.
    • OK — run hygiene: fresh MinIO data directory and unique bucket pair per matrix attempt, fresh service data directory; teardown after each attempt verified no lingering processes and released ports 6001/16001/16002 and 9000/9001.
    • Not covered — a full end-to-end physical backup and restore of a live cluster, including restore of an empty TAE object: the hand-off notes this has no sufficient verification record yet; this round verifies the copy/checksum layer where the defect lives (the issue's own reproduction scope), and a full backup/restore run remains natural follow-up material.
    • Not covered — deterministic live-server injections of StatFile failure, Close failure or mid-checksum cancellation: race-prone against a real object server; they are covered deterministically by the merged focused tests named above, and no separate live-server injection was attempted.
    • Not covered — MatrixOne 4.2-dev: the fix merge and this issue target main; no 4.2-dev build was verified and no 4.2-dev conclusion is claimed.

    Findings

    • Real-MinIO matrix: RESULT32413 cases=7 failed=0 — PASS, overlay exit 0.
    • Focused suite on the merged tip: ok github.com/matrixorigin/matrixone/pkg/backup — 15/15 top-level tests, 0 failures.
    • Big-data regression: not required. The defect is a per-object contract at the 0-byte boundary of the backup copy/checksum phase; the outcome is fully determined by object size and error precedence (the 0/1/8192-byte controls above pin it), independent of row counts, LIMIT, block/batch boundaries, memory/spill, concurrency scale, skew, network transfer, index state or resource scale. Data volume cannot surface a new outcome class for this defect.
    • Engine-parallel verification: not applicable — the copy phase operates on single objects with no multi-worker execution path. The standard multi-endpoint deployment was connected (3/3 identity) for environment sanity, while the defect-path matrix ran at the storage layer, exactly as the issue was originally reported.
    • Raw evidence archived locally: the overlay test file, MinIO launch log, matrix run log, build log and endpoint identity log; available on request.

    MOTR / BVT Coverage

    • No new MOTR/BVT case was added for this verification. The fix landed with in-repo pkg/backup contract tests that already encode the empty-object proof, precedence rules and readback behaviour; the defect is a Go storage-layer contract that SQL-level .test files cannot express, and the hand-off scoped this issue's acceptance to the real-MinIO copy controls. The complementary full-backup/restore-shaped regression remains follow-up material as recorded under Not covered.

    Final Conclusion

    Fixed — verified on main at 553e16f52b (contains fix merge 2f6fcc7721, PR #32434): a successful provider copy of a real empty MinIO object now completes with the full 32-byte empty digest and a visible size-0 destination through both public copy APIs on the issue's original MinIO release (2025-09-07), missing objects still fail properly, one-byte, repeated and non-empty copies stay correct, and the causal precedence for cancellation, StatFile and Close failures remains locked by the merged focused tests.

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

Metadata

Metadata

Assignees

Labels

kind/bugneeds-triage

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions