Repository navigation
Transaction exception catch - #13703
Conversation
…ure transaction status is set to failed
…ure to ensure transaction status is set to failed
|
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
…' or 'failed' during error handling
| $transaction = $authorization->skip(fn () => $dbForProject->updateDocument( | ||
| 'transactions', | ||
| $transactionId, | ||
| new Document(['status' => 'committed']) | ||
| )); |
There was a problem hiding this comment.
After the tenant-data transaction commits, this separate update from committing to committed can still throw. It is now outside the failure handling and has no reconciliation path, so a project-database failure can leave durable tenant writes paired with an indefinitely committing transaction and return an error to the client. A later completion attempt cannot recover it because the endpoint accepts only pending transactions.
Knowledge Base Used: Database data API and transactions
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/Appwrite/Platform/Modules/Databases/Http/Databases/Transactions/Update.php
Line: 354-358
Comment:
**Status Can Remain Committing**
After the tenant-data transaction commits, this separate update from `committing` to `committed` can still throw. It is now outside the failure handling and has no reconciliation path, so a project-database failure can leave durable tenant writes paired with an indefinitely `committing` transaction and return an error to the client. A later completion attempt cannot recover it because the endpoint accepts only `pending` transactions.
**Knowledge Base Used:** [Database data API and transactions](https://app.greptile.com/appwrite/-/custom-context/knowledge-base/appwrite/appwrite/-/docs/database-data-api.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.…ommitted' or 'failed' during error handling" This reverts commit ded0528.
What does this PR do?
(Provide a description of what this PR does and why it's needed.)
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Screenshots may also be helpful.)
Related PRs and Issues
Checklist