Project

General

Profile

Actions

Bug #104407

open

OrphanRecordsCommand fails if list of ids is too long

Added by Roman Teitge 4 months ago. Updated 9 days ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2024-07-17
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
13
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When running typo3 cleanup:orphanrecords -v via CLI in a big instance mysql throws error because of exceeding the query size limit.
At https://github.com/TYPO3-CMS/lowlevel/blob/main/Classes/Command/OrphanRecordsCommand.php#L102 it searches for all records that are NOT connected. But the $idList array parameter for the notIn() condition is very long in a big instance. And it grows if new entries are added, so raising the query size limit would do it only for the moment. Not to mention the consumption of resources (RAM, CPU).

Actions #1

Updated by Garvin Hicking 3 months ago

  • Category set to Database API (Doctrine DBAL)
Actions #2

Updated by Benni Mack 24 days ago

  • Status changed from New to Needs Feedback

Hmm, that might also be an issue in other places then.

Can you give us some more context:

a) how many pages do you have in your installation?
b) does this also occur in v12?
c) what option did you tune MySQL to make the query size bigger?

Actions #3

Updated by Roman Teitge 9 days ago

Benni Mack wrote in #note-2:

Hmm, that might also be an issue in other places then.

Can you give us some more context:

a) how many pages do you have in your installation?

We've approx. 86k pages over 700 root pages.

b) does this also occur in v12?

With our update to v12 which is in test stage now there is no error anymore like this. We only need to run this process with a php memory_limit 2G flag.

c) what option did you tune MySQL to make the query size bigger?

You can raise the max_allowed_packet option in MySQL (https://dev.mysql.com/doc/refman/8.4/en/packet-too-large.html) or MariaDB (https://mariadb.com/docs/server/ref/mdb/system-variables/max_allowed_packet/)

So it seems to be a v11 issue and not v12.

Actions

Also available in: Atom PDF