Skip to content

fix: return 503 instead of 404 when commit metadata is missing - #232

Merged
Vonng merged 4 commits into
pgsty:mainfrom
julienlau:julienlau/fix/commit-metadata-missing-503
Oct 15, 2026
Merged

Vonng merged 4 commits into
pgsty:mainfrom
julienlau:julienlau/fix/commit-metadata-missing-503

Conversation

@julienlau

@julienlau julienlau commented Oct 12, 2026 •

Copy link
Copy Markdown

Problem

If staged xl.meta disappears at the final metadata rename inside xlStorage.RenameData(), the old errFileNotFound classification can report 400 IncompleteBody for PUT or 404 NoSuchKey for multipart completion. A server-side commit failure should be retryable.

Change

Return a dedicated errCommitMetaMissing only at the final metadata commit. Preserve it across storage RPC, reduce failed write quorums to errErasureWriteQuorum, and map the direct object/healing path to InsufficientWriteQuorum. The actual S3 response is HTTP 503 with code SlowDownWrite.

Staging failures retain their existing classification. A successful write quorum is preserved, and a failed write still rolls back only its successfully committed drives. Storage formats, RPC fields and dependencies are unchanged. This classifies the failure; it does not restore lost staging data or guarantee that a retry succeeds.

Validation

  • Deterministic real-storage tests remove staged metadata after it is written, covering empty objects and renamed data directories, and assert SlowDownWrite/503.
  • Quorum tests cover all-drive failure, quorum failure, an 8/8 split, successful quorum, staging errors and rollback boundaries.
  • Storage RPC string remapping and object/API error mapping are covered.
  • Focused upload/completion regressions, targeted race tests, make verifiers and make build pass locally on Go 1.27.2.
  • Restoring the old storage implementation makes both new real-storage regressions fail with file not found, confirming that they detect the original defect.

pepitedata and others added 4 commits October 12, 2026 16:11
When the staged xl.meta disappears between the data rename and the
meta-file commit inside RenameData(), the affected drives return
errFileNotFound. An in-quorum errFileNotFound is reduced by
reduceWriteQuorumErrs() and previously surfaced as:

- IncompleteBody (400) from PutObject(), misattributing the failure
  to a client disconnect, or
- ObjectNotFound (404 NoSuchKey) from CompleteMultipartUpload(),
  telling clients the object is absent so they skip retries.

Map errFileNotFound at the commit step to a dedicated internal
errCommitMetaMissing, convert it to errErasureWriteQuorum in
renameData(), and map it to InsufficientWriteQuorum (HTTP 503) in
toObjectErr() so clients retry. Below-quorum outcomes already return
InsufficientWriteQuorum and are unchanged, as is the IncompleteBody
mapping for staging failures of client-disconnected uploads.

Signed-off-by: Julien Laurenceau <[email protected]>
Drive renameData() with stub disks to assert that an in-quorum
errCommitMetaMissing is converted to errErasureWriteQuorum (HTTP 503)
and that an in-quorum errFileNotFound still surfaces unchanged so
PutObject() keeps returning IncompleteBody for client disconnects.

Signed-off-by: Julien Laurenceau <[email protected]>
@Vonng
Vonng merged commit a592d69 into pgsty:main Oct 15, 2026
8 checks passed
@Vonng Vonng added this to the 20261018 milestone Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants