#110537Add cleanup support for big tables in TableGarbageCollectionTask
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
-
Stefan Bürk changed assigned to Stefan Bürk <span data-processor="relativetime" data-value="2026-08-26T12:11:23+00:00" > 08/26/26, 12:11 </span>
-
Josef Glatz changed description status
NewAccepted <span data-processor="relativetime" data-value="2026-08-26T12:59:42+00:00" > 08/26/26, 12:59 </span> -
Josef Glatz changed description <span data-processor="relativetime" data-value="2026-08-26T13:00:17+00:00" > 08/26/26, 13:00 </span>
-
Gerrit Code Review pushed patch set 1 for main to change 95731 status
AcceptedUnder Review <span data-processor="relativetime" data-value="2026-09-08T16:36:21+00:00" > 09/08/26, 16:36 </span> -
Gerrit Code Review pushed patch set 2 for main to change 95731 <span data-processor="relativetime" data-value="2026-09-08T17:09:13+00:00" > 09/08/26, 17:09 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 95731 <span data-processor="relativetime" data-value="2026-09-29T14:42:44+00:00" > 09/29/26, 14:42 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 96190 <span data-processor="relativetime" data-value="2026-09-30T05:32:38+00:00" > 09/30/26, 05:32 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 96191 <span data-processor="relativetime" data-value="2026-09-30T05:36:36+00:00" > 09/30/26, 05:36 </span>
-
Stefan Bürk commented and changed status
Under ReviewResolved done0 %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.