-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Enforce operations cap per transaction #10319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enforce operations cap per transaction #10319
Conversation
Update migrations
Add placeholder detection
…oker Feat: Make functions worker customizable
Co-authored-by: jakeb994 <jakeb994@gmail.com>
Co-authored-by: jakeb994 <jakeb994@gmail.com>
…mmand Update build command for flutter
Skip redundant subqueries in users list route
…ache-clearing-bug-2799 Fix databases worker cache clearing bug
…e-function-broker Revert "Feat: Make functions worker customizable"
This reverts commit 7e110bf.
Feat: Redis functions queue (reapply with fixes)
…ate-required-attributes # Conflicts: # composer.json # composer.lock
…ate-required-attributes
Update package
Update required attributes
…rnings chore: remove experiment warnings from bulk methods
# Conflicts: # app/config/specs/open-api3-latest-client.json # app/config/specs/open-api3-latest-console.json # app/config/specs/open-api3-latest-server.json # app/config/specs/swagger2-latest-client.json # app/config/specs/swagger2-latest-console.json # app/config/specs/swagger2-latest-server.json # app/controllers/api/databases.php # composer.lock # src/Appwrite/SDK/Specification/Format/OpenAPI3.php
Co-authored-by: jakeb994 <jakeb994@gmail.com>
Cursor Agent can help with this pull request. Just |
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (4)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
Security Scan Results for PRDocker Image Scan Results
Source Code Scan Results🎉 No vulnerabilities found! |
✨ Benchmark results
⚡ Benchmark Comparison
|
…operations Co-authored-by: jakeb994 <jakeb994@gmail.com>
...rite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Attribute/Decrement.php
Outdated
Show resolved
Hide resolved
… actions Co-authored-by: jakeb994 <jakeb994@gmail.com>
What does this PR do?
This PR enforces a per-transaction operations cap across all database operations that stage transactions. This ensures consistency with the existing
AddOperations
behavior, preventing a single transaction from exceeding the defined operation limit.The enforcement logic is applied to:
Create
,Update
,Delete
,Upsert
Bulk/Delete
,Bulk/Update
,Bulk/Upsert
Attribute/Increment
,Attribute/Decrement
For each affected operation, the
plan
parameter is injected (if not already present), and a check is performed before staging the operation to ensure the transaction's operation count does not exceeddatabasesBatchSize
(orAPP_LIMIT_DATABASE_BATCH
by default).Test Plan
APP_LIMIT_DATABASE_BATCH
is set to a small number (e.g., 1 or 2) in your.env
file for easier testing.POST /databases/{databaseId}/transactions
). Note thetransactionId
.Create
,Update
,Delete
,Upsert
a single document, orIncrement
/Decrement
an attribute within the transaction.APP_LIMIT_DATABASE_BATCH
is 1 or more.Exception::TRANSACTION_LIMIT_EXCEEDED
ifAPP_LIMIT_DATABASE_BATCH
is 1.Bulk/Create
,Bulk/Update
, orBulk/Upsert
operation with multiple documents (e.g., 2 documents).Exception::TRANSACTION_LIMIT_EXCEEDED
ifAPP_LIMIT_DATABASE_BATCH
is 1.APP_LIMIT_DATABASE_BATCH
is set to a value greater than or equal to the number of documents in the bulk operation.Related PRs and Issues
Checklist