Bug #90977

possible race condition in indexedsearch

Added by Jonas Eberle over 1 year ago. Updated about 2 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Indexed Search
Target version:
-
Start date:
2020-04-07
Due date:
% Done:

0%

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

Description

During artificially high load on a dev system (9.5.15) with 6 php-fpm threads I am able to provoke

An exception occurred while executing 'INSERT INTO `index_words` (`wid`, `baseword`, `metaphone`) VALUES (?, ?, ?)' with params [139691952, "gelungenen", "99353181"]: Duplicate entry '139691952' for key 'PRIMARY'

Backtrace:

...
at TYPO3\CMS\Core\Database\Connection->insert('index_words', array('wid' => 139691952, 'baseword' => 'gelungenen', 'metaphone' => '99353181'))
in /var/www/html/src/public/typo3/sysext/indexed_search/Classes/Indexer.php line 2170

at TYPO3\CMS\IndexedSearch\Indexer->checkWordList(array('unkomplizierte' => array('first' => 1, 'hash' => 19668563, 'metaphone' => '1229927', 'count' => 1), 'flügelkonzept' => array('first' => 5, 'hash' => 180729245, 'metaphone' => '146113107', 'count' => 1), 'neuesten' => array('first' => 10, 'hash' => 188782041, 'metaphone' => '67006256', 'count' => 1), 'erkenntnisse' => array('first' => 11, 'hash' => 15462739, 'metaphone' => '180751463', 'count' => 4), 'forschung' => array('first' => 13, 'hash' => 152791788, 'metaphone' => '99883556', 'count' => 1), 'langjährigen' => array('first' => 16, 'hash' => 82744380, 'metaphone' => '128523246', 'count' => 1), 'mflugzeugen' => array('first' => 23, 'hash' => 38128782, 'metaphone' => '7174348', 'count' => 1), 'resultat' => array('first' => 25, 'hash' => 209439804, 'metaphone' => '167262399', 'count' => 2), 'harmlose' => array('first' => 32, 'hash' => 251103929, 'metaphone' => '204428637', 'count' => 1), 'gleitleistung' => array('first' => 36, 'hash' => 132977964, 'metaphone' => '31057351', 'count' => 1), 'offenen' => array('first' => 44, 'hash' => 215076010, 'metaphone' => '7547654 ...

This seems to be a race condition as it does not show itself under low loads. Yet it is very seldom.


Related issues

Related to TYPO3 Core - Bug #84541: Uncaught TYPO3 Exception in indexed_search: duplicate key (hash) errorNew2018-03-27

Actions
#1

Updated by Xavier Perseguers about 2 months ago

Didn't investigate with load (unsure there's a high load at all) but can reproduce this problem under TYPO3 v10.

#2

Updated by Jonas Eberle about 2 months ago

I suspected it was about 2 threads concurrently indexing and racing checks for "term exists already" vs. persisting, but it might also only depend on a specific current state + newly indexed terms.

I would love to have a reproducible case but wasn't able to come up with one.

#3

Updated by Xavier Perseguers about 2 months ago

  • Related to Bug #84541: Uncaught TYPO3 Exception in indexed_search: duplicate key (hash) error added

Also available in: Atom PDF