Repository navigation
Fix deletion worker pagination over retained documents - #14159
Merged
Merged
Conversation
🟢 Tier S · Ready to merge
Replaces the deletion worker’s manual pagination loop with the database library’s iterator, preserving the 1,000-document page size, callbacks, and completion logging. Adds a SQLite-backed worker regression that verifies execution retention visits 2,837 functions and one site exactly once without deleting the resources.
📂 Walkthrough · 2
Reviewed |
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a deletion worker lists at least two full pages of retained documents,
listByGroup()keeps the first cursor and rereads the second page indefinitely. In Cloud SFO, deleting a function with 2,837 deployments repeatedly published invalidations for the same 1,000 deployments, filling the edge queue with millions of jobs and preventing deletion from completing. See appwrite-labs/cloud#6322.Replace the manual pagination loop with the database library’s existing
iterate()method. Keep the 1,000-document page size, callback and completion log; remove 22 production lines.Validation: targeted Pint and PHPStan checks pass. Before removing the regression test from this PR, it was observed failing on the original code at repeated resource sequence 1,001 and passing with the fix on local PHP and in the Appwrite development container. The final diff contains no regression test.
The full Cloud → edge → Redis invalidation path was not run end to end. Production root cause was independently confirmed with a bounded read-only database reproduction, recorded on the incident. Cloud must consume the fixed CE source and deploy the deletion worker before production is repaired; queue eviction and interrupted deletion recovery remain tracked on the incident.