Project

General

Profile

Actions

Bug #87139

closed

Regression: getTreeList inserts duplicate keys in cache_treelist

Added by Alexander Schnitzler over 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Should have
Category:
Caching
Target version:
Start date:
2018-12-12
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

Unfortunately https://review.typo3.org/58951/ did not actually solve issues 86028 and 86491 for good.

There are several issues with the last approach:

1) The expiration time of all created caches was 0, which resulted in a permanent creation and deletion of cache entries. This behaviour cannot be called caching.
2) Number 1 increases the chance for race conditions where several parallel requests tried to create the same cache entry.

The solution:

New cache entries get an expiry date of 2145909600 (that's equal PHP_INT_MAX (32bit) and the same number that is used in the caching framework).
Also, new caches are created within a transaction, which prevents duplicate key errors.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #86028: getTreeList inserts duplicate keys in cache_treelistClosedAlexander Schnitzler2018-08-29

Actions
Related to TYPO3 Core - Bug #86491: Duplicate entry for PRIMARY key in cache_treelistClosedAlexander Schnitzler2018-10-01

Actions
Actions #1

Updated by Alexander Schnitzler over 5 years ago

  • Related to Bug #86028: getTreeList inserts duplicate keys in cache_treelist added
Actions #2

Updated by Alexander Schnitzler over 5 years ago

  • Related to Bug #86491: Duplicate entry for PRIMARY key in cache_treelist added
Actions #3

Updated by Gerrit Code Review over 5 years ago

  • Status changed from Accepted 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/59127

Actions #4

Updated by Gerrit Code Review over 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/59127

Actions #5

Updated by Markus Klein over 5 years ago

  • Description updated (diff)
Actions #6

Updated by Markus Klein over 5 years ago

To reduce the load on the server while massive number of requests do the same work to generate the cache content, I propose to employ locking instead of transactions. Paradigm: Do work only once.

Basic scheme:

  • try cache
  • when hit, return
  • when miss, then acquire lock
  • try cache again (might have been filled meanwhile)
  • when hit, release lock, return
  • when miss, generate content
  • store cache entry, release lock, return
Actions #7

Updated by Gerrit Code Review over 5 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59127

Actions #8

Updated by Gerrit Code Review over 5 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59127

Actions #9

Updated by Gerrit Code Review over 5 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59127

Actions #10

Updated by Gerrit Code Review over 5 years ago

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/59139

Actions #11

Updated by Anonymous over 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #12

Updated by Benni Mack almost 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF