Skip to content

fix(backup): verify empty provider-copied objects without EOF failure - #32434

Merged
mergify[bot] merged 3 commits into
matrixorigin:mainfrom
aptend:fix/astra-meow-32413
Nov 10, 2026
Merged

mergify[bot] merged 3 commits into
matrixorigin:mainfrom
aptend:fix/astra-meow-32413

Conversation

@aptend

@aptend aptend commented Nov 9, 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:

issue #32413

Fixes #32413

What this PR does / why we need it:

A physical backup of an empty (0-byte) object could fail after the storage
provider had already copied the object successfully: when checksum
verification read the object back and that Read returned io.EOF, the old
code treated the EOF as a read failure, so a run whose copy actually
succeeded was marked failed.

pkg/backup (tae.go) now accepts the empty object only with a strict proof:

  • when a filesystem Read returns io.EOF on open, checksumFile requires the
    same filesystem and the same object name to StatFile-prove the object
    exists with size 0, and requires no context cancellation, Read
    cancellation or Close error, before the 32-byte SHA-256 empty digest is
    produced;
  • every reader handed out for that check is closed exactly once, and a
    missing object, a non-empty object, a StatFile failure, a Close failure
    or cancellation never verifies as an empty object;
  • after a successful provider copy, the checksum is computed over the
    destination entry. A provider copy error is returned directly; the local
    read path is used only when the provider reports the copy unhandled
    (false, nil) or does not implement the object copier.

The product change is limited to this checksum empty-object proof. The
object-copy precedence (the provider copy is used before source readers are
opened) and the retry semantics (a successful provider copy is never
repeated) are pre-existing behaviour, and the new tests lock them as
regressions; the backup metadata readback is exercised through the actual
saveTaeFilesList and sidecar test helpers.

Validation:

  • Focused CGo regression tests: 15 top-level tests, exit 0, with no failures or skips. Backup manifest and checksum-sidecar readback are included.
  • Local repository-pinned molint and golangci-lint 2.14.0 both exited 0 on all 44 affected directories, including tests and reverse dependencies, after rebasing onto the fresh upstream main snapshot.
  • All seven real MinIO provider-copy cases passed, with service and object cleanup: empty and one-byte copies through both public APIs, a nonempty control, missing-source 404, and cancellation after a successful copy. This evidence is reused for the unchanged copy/checksum paths; MinIO was built from the official RELEASE.2023-11-01T18-37-25Z source tag.
Local validation commands

The commands used CGo and the worktree's native include/link environment, with the unchanged repository linter configuration.

.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -v -timeout 420s -run '^(TestBackupMinioSizePolicy|TestBackupSizeReader|TestBackupSizedCopy|TestBackupSizedCopyLogicalLocalSize|TestChecksumFileReadEOFProvesEmptyObject|TestChecksumFileReadEOFAttachedReader|TestChecksumFileReadEOFCausePrecedence|TestCopyFileUsesProviderCopyBeforeOpeningSourceReaders|TestCopyFileFallbackReadsSourceOnce|TestCopyFileWithRetryDoesNotRepeatSuccessfulProviderCopy|TestCopyFileProviderEmptyObject|TestCopyFileWithRetryProviderEmptyObject|TestCopyFileWithRetryProviderOneByteObject|TestCopyFileWithRetryEOFWithNonEmptyTarget|TestCopyFileWithRetryProviderStatFailures)$' ./pkg/backup

STATIC_CHECK_PACKAGES="./cmd/mo-service ./pkg/backup ./pkg/bootstrap ./pkg/bootstrap/versions/v1_2_0 ./pkg/bootstrap/versions/v2_0_0 ./pkg/bootstrap/versions/v2_0_1 ./pkg/bootstrap/versions/v2_0_2 ./pkg/bootstrap/versions/v2_2_0 ./pkg/bootstrap/versions/v3_0_0 ./pkg/bootstrap/versions/v4_0_0 ./pkg/bootstrap/versions/v4_0_7 ./pkg/cnservice ./pkg/datasync ./pkg/embed ./pkg/frontend ./pkg/frontend/test/mock_moserver ./pkg/fulltext/plugin/iscp ./pkg/fulltext2/plugin/iscp ./pkg/indexplugin/iscp ./pkg/iscp ./pkg/proxy ./pkg/sql/colexec/apply ./pkg/sql/colexec/productl2 ./pkg/sql/colexec/table_function ./pkg/sql/compile ./pkg/tests/arrowload ./pkg/tests/dml ./pkg/tests/issues ./pkg/tests/issues/internal/joinspill ./pkg/tests/issues/isolated ./pkg/tests/partition ./pkg/tests/service ./pkg/tests/shard ./pkg/tests/sqlintegration ./pkg/tests/sqlintegration/multicn ./pkg/tests/testutils ./pkg/tests/txn ./pkg/tests/upgrade ./pkg/tnservice ./pkg/util/test ./pkg/vectorindex/hnsw/plugin/iscp ./pkg/vectorindex/ivfflat/plugin/iscp ./pkg/vm/engine/test ./pkg/vm/engine/test/testutil"
molint check -mod=readonly $STATIC_CHECK_PACKAGES
golangci-lint run --allow-serial-runners --timeout=15m -c .golangci.yml $STATIC_CHECK_PACKAGES

@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 Nov 9, 2026
@XuPeng-SH

XuPeng-SH commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: 99a88c256d3da65d69c0f84cff97989982057591

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: 99a88c256d3da65d69c0f84cff97989982057591

Assessment: approve

The EOF-only zero-size proof fixes legitimate empty copies while preserving reader cleanup and cancellation/error precedence. It reuses existing checksum, stat and retry paths without adding shared state or changing backup formats. No actionable findings remain.

Model: gpt-6.1-sol / max

Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0

Validation:

  • Reviewed the complete three-file delta, checksum consumers and linked issue; reconciled both discussion entries.

  • All 15 focused regressions and all 72 owning-package tests passed in normal CPU mode, including manifest/sidecar readback. Explicit go vet, gofmt and diff --check passed.

  • Preflight passed. Go 1.27.1 archive integrity and rebuilt native-input provenance were verified. Claimed checks match retained logs and receipts in validation-audit.json; source remains unchanged.

Limitations:

  • Real MinIO integration and 44-directory lint results remain attributed author reports; they were not independently repeated locally.

  • Initial toolchain/download attempts were incomplete setup diagnostics and receive no validation credit. Completed replacement checks passed.

@mergify

mergify Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

✅ Merged into main as 2f6fcc7 at 02:25 UTC

2 h 3 min in the queue, 1 h 8 min of it CI.

So far

  • ✅ Entered the queue Tue 10 Nov, 00:22 · rule main · triggered by rule Automatic queue on approval for main
  • ✅ Passed · in place
  • ✅ Merged 02:25 · 2f6fcc7 · squash
3 merge conditions met
  • #review-threads-unresolved = 0 · required by GitHub branch protection
  • github-review-approved · required by GitHub branch protection
  • any of · required by GitHub branch protection:
    • check-success = CI Required
    • check-neutral = CI Required
    • check-skipped = CI Required

Times in UTC · dashboard · how the merge queue works

@XuPeng-SH

XuPeng-SH commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

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

Commit: 0c5839dda89480fc54d28a3f8ac5c00ccbb742bc

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: 0c5839dda89480fc54d28a3f8ac5c00ccbb742bc

Assessment: approve

The EOF-only proof accepts a verified existing zero-length object while preserving cancellation, close/stat failures and checksum-only retry ownership. It reuses the existing checksum/stat path without changing backup formats or adding shared state. No actionable findings.

Model: gpt-6.1-sol / max

Session: 01a1a004-90c3-73b1-acc9-3d4636452003 · slot 0 · generation 0

Validation:

  • Reviewed the complete three-file delta, all checksum consumers, MinIO read/stat behavior, manifest/sidecar handling, linked issue #32413 and all five discussion entries.

  • Isolation preflight and source/gofmt audit passed: checks/1794272373096296573-3.json and checks/1794272662988033796-3.json; retained logs and validation-audit.json match commands, source and exits.

  • Author reports 15 focused CGo regressions and seven real-MinIO cases passing. Prior review reports 72 owning-package normal passes; backup, FileService, module and native inputs are unchanged from that reviewed head.

Limitations:

  • No fresh local Go tests: required Go1.27.1 download timed out before compilation or execution (checks/1794272581795864576-3.json). This is a setup diagnostic.

  • Product-test, MinIO and lint results remain attributed reports without supplied raw logs. Intervening vector/compile changes prevent claiming complete prior package-build equivalence.

  • Frozen UT/SCA checks remain in progress. Manifest readback does not establish a full restore of an empty TAE object.

This branch was previously deployed

1 inactive deployment
ci — 48a8abca Deployed Nov 10, 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 size/L Denotes a PR that changes [500,999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants