-
Notifications
You must be signed in to change notification settings - Fork 154
Open
Description
Feature Request / Improvement
Implement CommitTransaction() on the REST catalog, satisfying the TransactionalCatalog interface.
Wire Format
POST /v1/{prefix}/transactions/commit
Content-Type: application/json
{
"table-changes": [
{
"identifier": { "namespace": ["db"], "name": "t1" },
"requirements": [
{ "type": "assert-table-uuid", "uuid": "..." },
{ "type": "assert-ref-snapshot-id", "ref": "main", "snapshot-id": 123 }
],
"updates": [
{ "action": "add-snapshot", ... },
{ "action": "set-snapshot-ref", ... }
]
},
{
"identifier": { "namespace": ["db"], "name": "t2" },
"requirements": [ ... ],
"updates": [ ... ]
}
]
}
Response: 204 No Content
Error Handling
| Status | Error | Meaning |
|---|---|---|
| 404 | ErrNoSuchTable |
A referenced table doesn't exist |
| 409 | ErrCommitFailed |
One or more requirements failed — entire transaction rejected |
| 500, 502, 504 | ErrCommitStateUnknown |
Server error — commit may or may not have been applied |
| 503 | ErrCommitStateUnknown |
Service unavailable |
On 409, no tables are modified — all-or-nothing semantics.
Implementation Notes
- Reuse existing
doPostAllowNoContenthelper withallowNoContent=true(expects 204) - Same error mapping pattern as
CommitTable(rest.go:828-835) - JSON field name on the wire is
"table-changes"(kebab-case, matching Java'sCommitTransactionRequestParser) - Each entry in
table-changesreuses the existingidentifier,requirements, andupdatesserialization - No response body to parse
- No retry logic built in (matches Java behavior — retries are the caller's responsibility)
Validation
commitslist must not be empty- Every commit must have a non-nil
Identifier(unlike single-table commit where the identifier is in the URL path)
References
Depends On
TransactionalCataloginterface andTableCommittype add TransactionalCatalog interface for multi-table atomic commits #784
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels