Bug #89716
closedidentifier not null in sys_file_processedfile
100%
Description
I'm running a TYPO3 v9.5.11 with an implementation of adaptive images which leads to a huge amount of processed files.
Additionally if have upscaling disabled:
$GLOBALS['TYPO3_CONF_VARS']['GFX']['processor_allowUpscaling'] = false;
So in many cases the original files should get rendered in fe without processing.
This change led to a performance slump, which was inexplicable to me.
During my research i have found some processed files in the database, which are updated on every request even if the page should be cached.
These entries have the following properties set:
identifier='' name=null
After more search I came to bug #62400 which is "Rejected" and points me to the TYPO3\CMS\Core\Resource\ProcessedFile:
* A file may also meet the expectations set in the configuration without any processing. In that case, the * ProcessedFile object still exists, but there is no physical file directly linked to it. Instead, it then * redirects most method calls to the original file object. The data of these objects are also stored in the * database, to indicate that no processing is required. With such files, the identifier and name fields in the * database are empty to show this.
Therefore, the existence of these entries is correct. But i think these properties should have the same value (null) in the database:
identifier=null name=null
These files are always touched while the condition never matches in \TYPO3\CMS\Core\Resource\ProcessedFile::usesOriginalFile
public function usesOriginalFile()
{
return $this->identifier === null || $this->identifier === $this->originalFile->getIdentifier();
}
or in \TYPO3\CMS\Core\Resource\ProcessedFile::updateWithLocalFile
if ($this->identifier === null) {
throw new \RuntimeException('Cannot update original file!', 1350582054);
}
To fix this the database structure should get fixed.
The identifier is created like this:
identifier varchar(512) DEFAULT '' NOT NULL,
But the default should be NULL
identifier varchar(512) DEFAULT NULL,
Only in this case, the condition matches and the files are not constantly updated.
Updated by Florian Schuhmann about 5 years ago
- Related to Bug #62400: Lot of entries in sys_file_processed with name=NULL and identifier empty added
Updated by Florian Schuhmann about 5 years ago
- Subject changed from identifier not null in sys_file_processed to identifier not null in sys_file_processedfile
Updated by Markus Klein about 5 years ago
Good catch. For backporting such changes though, we can't do DB schema adjustments.
So do you see a good way to adjust the conditions accordingly?
Feel free to push a patch to Gerrit. Thanks.
Updated by Gerrit Code Review almost 5 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62538
Updated by Gerrit Code Review almost 5 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62538
Updated by Gerrit Code Review over 4 years ago
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63452
Updated by Anonymous over 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 68d8281fef49fc0de8d0afe74106491d5039837f.
Updated by Gerrit Code Review over 4 years ago
- Status changed from Closed to Under Review
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63657
Updated by Anonymous over 4 years ago
- Status changed from Under Review to Resolved
Applied in changeset 7d765c8d3be1d15f087a659c75c41e2275d9e0d9.
Updated by Anonymous almost 4 years ago
Anonymous wrote in #note-10:
Applied in changeset 7d765c8d3be1d15f087a659c75c41e2275d9e0d9.
Awesome!