Skip to content

[1.9.x] Backport expired transaction cleanup batching fix (#13563) #15355

Open

Description

@viet0340

I'm running a self-hosted Appwrite 1.9.10 instance with MongoDB and have encountered a maintenance failure when more than 5,000 expired transaction IDs are processed.

The appwrite-worker-deletes worker collects expired transaction sequence IDs and passes the entire list into a single Query::equal('transactionInternalId', ...) call.

When the list exceeds the database's query-value limit, the maintenance job fails.

Existing upstream fix

This issue was already addressed in PR #13563:

#13563

The fix splits transaction IDs into batches using the database-configured maximum query-value limit.

However, the current 1.9.x branch, including version 1.9.10, still contains the original unbatched implementation.

Production impact

  • Maintenance jobs can fail when more than 5,000 expired transactions accumulate.
  • Transaction logs may remain orphaned after the transaction records are deleted.
  • The problem becomes more likely as transaction volume increases.
  • Running maintenance more frequently only reduces the likelihood of hitting the limit; it does not resolve the underlying issue.

We have temporarily reduced _APP_MAINTENANCE_INTERVAL to 1,800 seconds (30 minutes) to mitigate the problem.

Request

Could the Appwrite team please consider backporting PR #13563 to the 1.9.x maintenance branch and including it in a future 1.9.x patch release?

The upstream fix is narrowly scoped, and the database query-limit API is already available in the dependencies used by Appwrite 1.9.10.

This would help self-hosted installations remain stable without requiring custom Docker images or manual database cleanup.

Thank you!

Activity

  1. added
    product / databases
    product / self-hosted
    product / storage
    on Nov 5, 2026
  2. removed
    product / storage
    product / self-hosted
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    product / databases

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions