Issue Bug Resolved

#110537Add cleanup support for big tables in TableGarbageCollectionTask

Josef Glatz 08/26/26, 11:49 updated 09/30/26, 05:50

Description

Table Garbage Collection Task: no batching in TYPO3 core

We reviewed the TYPO3 Scheduler task TableGarbageCollectionTask in both TYPO3 12.4 and the current main branch.

No LIMIT, paging, or batch processing has been added. For each configured table, the task still executes one single DELETE statement for all records matching the expiration condition.

This is therefore potentially problematic for a table containing several million entries (like in sys_history or sys_log): the deletion runs as one large database transaction. In a Galera cluster, this can lead to errors such as:

  • Transaction size exceed set threshold
  • high database load
  • long-running locks
  • or Galera flow control

Error

Execution failed: 1308255491, TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask failed for table sys_history with error: An exception occurred while executing a query: Got error 5 - 'Transaction size exceed set threshold' during COMMIT

Possible Solution

Is it possible to adopt the class to delete entries in small batches per default?

Reviews 3

History 49

  1. Gerrit Code Review pushed patch set 1 for main to change 95731 status Accepted Under Review <span data-processor="relativetime" data-value="2026-09-08T16:36:21+00:00" > 09/08/26, 16:36 </span>

  2. Stefan Bürk commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-09-30T05:50:10+00:00" > 09/30/26, 05:50 </span>

    Applied in changeset commit:c7a9a72d1b3ed940a9e37ba43697bbfebf63df42.