Repository navigation
Conversation
After a lost response only a later attempt tells whether a conditional write landed. A killed query cut that attempt, so a published Iceberg commit counted as lost and its rollback deleted the files of the new version. Run a conditional `PutObject` or `CompleteMultipartUpload`, and the version hint update after a published commit, under a `QueryCancellationBlocker`.
It also fixes a bug on master, so it moves to #132317, which must merge first.
|
Workflow [PR], commit [a2193ae] Summary: ❌
AI ReviewSummaryReviewed head Missing context / blind spots
Final VerdictStatus: ✅ Approve. |
When the upload of `vN.metadata.json` was sent and failed without proof either way, the commit counted as lost, and its rollback deleted the files that the stored metadata file references. `writeMetadataFile` now throws `UNKNOWN_STATUS_OF_TRANSACTION` then, and the callers keep the files.
An error of the hint read after the metadata file was published reached the caller, which rolled back the published version.
The client records whether an attempt may have been applied and proves the outcome by the idempotency id. An unproven outcome marks the error, which keeps its S3 error type. The client no longer blocks cancellation.
An unmarked S3 error proves that nothing was published, so the commit rolls back instead of keeping orphan files.
An S3 error without the mark, for example from the check after the upload, made the commit roll back a published version.
Any 3xx or 4xx counted as a refusal, also codes that some clients and proxies give for no answer, such as 408 or 499.
An attempt on another thread, e.g. of an asynchronous call, would lose its answer, so the write could be taken for not applied.
It records whether an attempt may have been applied and the outcome of the write: applied, not applied, or unknown.
The tracker travels in `WriteSettings` to the request that publishes the object. A conditional write without a tracker is a logical error, and an exception inside an attempt counts as an attempt that may be applied.
The decision no longer depends on the type of the exception. A commit killed after only refusals rolls back, and an upload that succeeded is published even if the check after it fails.
A tracked attempt on another thread now reaches its tracker, and the HTTP client checks each tracked attempt by the mark in its request.
…quest The record lives on the request, and a scope private to the client finds it through the thread. The caller's tracker gets the outcome for now.
`WriteBufferFromFileBase::getWriteOutcome` replaces the tracker that the caller passed in `WriteSettings`. Iceberg reads it after the write.
The record of the attempts no longer leaves the client, so `ThreadPool` does not carry it, and requests carry no mark.
`WriteBufferFromS3` reports `NotApplied` when an upload of a part fails, also when `finalize` is never called.
The client marks an exception inside an attempt itself and decides the outcome in one place. Wrapped buffers no longer forward the outcome, so they count as not tracked.
The attempts of a publishing write go into its `AttemptsRecord`, which the scope of the call points to. `isConditionalWriteAttempt` names the check of `PocoHTTPClient`.
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes61 object files changed (+144.78 KiB total), 0 added.
716 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units3204 translation units recompiled, 13855 s compile time in total, 3204 of them have a recent master baseline. |
…e-outcome # Conflicts: # src/Common/FiberLocal.h
Related: #130811
Related: #130818
Related: #132744
An Iceberg commit could roll back after its
vN.metadata.jsonwas stored, e.g. after a lost upload response or a killedINSERT, and leave the table unreadable. Now the storage reports the outcome of the write (WriteBufferFromFileBase::getWriteOutcome). The commit rolls back only when nothing was applied; when the outcome is unknown, it fails withUNKNOWN_STATUS_OF_TRANSACTIONand keeps its files.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix an
Icebergtable that became unreadable when a commit was rolled back after its new metadata file was stored. When the outcome of the upload is unknown, the query now fails withUNKNOWN_STATUS_OF_TRANSACTIONand keeps the files.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/132317]