nastra commented on code in PR #7569:
URL: https://github.com/apache/iceberg/pull/7569#discussion_r1190704028
##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -846,6 +846,125 @@ paths:
5XX:
$ref: '#/components/responses/ServerErrorResponse'
+ /v1/{prefix}/transactions/commit:
+ parameters:
+ - $ref: '#/components/parameters/prefix'
+
+ post:
+ tags:
+ - Catalog API
+ summary: Commit updates to multiple tables in an all-or-nothing operation
+ operationId: commitTransaction
+ requestBody:
+ description:
+ Commit updates to multiple tables in an all-or-nothing operation
+
+
+ A commit for a single table consists of a table identifier with
requirements and updates.
+ Requirements are assertions that will be validated before attempting
to make and commit changes.
+ For example, `assert-ref-snapshot-id` will check that a named ref's
snapshot ID has a certain value.
+
+
+ Updates are changes to make to table metadata. For example, after
asserting that the current main ref
+ is at the expected snapshot, a commit may add a new child snapshot
and set the ref to the new
+ snapshot id.
+
+
+ A server implementation needs to guarantee that updates across
multiple tables are applied in an
+ all-or-nothing operation.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CommitTransactionRequest'
+ required: true
+ responses:
+ 204:
+ description: Success, no content
+ 400:
+ $ref: '#/components/responses/BadRequestErrorResponse'
+ 401:
+ $ref: '#/components/responses/UnauthorizedResponse'
+ 403:
+ $ref: '#/components/responses/ForbiddenResponse'
+ 404:
Review Comment:
The only case where I thought it might make sense to throw a 404 is when the
server gets changes for a table that doesn't exist (anymore). Alternatively we
could handle this case via a general `CommitFailedException`, but
`CommitFailedException` is retryable and I don't think we'd want to retry in
this particular case
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]