1

recently i've done mass attribute update and noticed that i got new processes in DB, like that:

INSERT INTO `search_tmp_5b069a25b016d1_83026725` SELECT `main_select`.`entity_id`, SUM(score) AS `relevance` FROM (SELECT DISTINCT `search_index`.`entity_id`, (((0) + (0) + (0) + (0) + (0)) * 1) AS `score`

problem is that the never-ending, they slowing down the server and what is most important - they creating new same processes until server reaches pm.max_children parameter value and PHP-fpm die.

please advise what is nature of this processes and how to kill it completely? (if I kill existing ones - new are borns after some time)

p.s. indexer processes are not running.

1

This is normal magento2 behaviour to store api type documents and pre-rendered attributes.

Please see the following classes:

Magento\CatalogSearch\Model\ResourceModel\Advanced\Collection

Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection

Magento\Framework\Search\Adapter\Mysql\Aggregation\Builder

Magento\Framework\Search\Adapter\Mysql\Mapper

Magento\Framework\Search\Adapter\Mysql\TemporaryStorage

Magento\Framework\Search\Adapter\Mysql\TemporaryStorageFactory.php

see: https://github.com/magento/magento2/blob/9c14af7a97bcf338662de365d2613c7ca9dbf8c6/lib/internal/Magento/Framework/Search/Adapter/Mysql/TemporaryStorage.php#L20

Due to your mass attribute update, the Observer that listens to the event controller_action_postdispatch_adminhtml_catalog_product_action_attribute_save is triggered to initiate re-indexing of the products updated in the mass-update.

<event name="controller_action_postdispatch_adminhtml_catalog_product_action_attribute_save">
    <observer name="flush_varnish_pagecache" instance="Magento\CacheInvalidate\Observer\InvalidateVarnishObserver"/>
</event>

in magento/module-cache-invalidate/etc/events.xml

  • yes, but product was re-indexed couple days ago, but this processes still running, i guess this is not normal... – bofh May 24 '18 at 13:06
  • I think you misunderstand. Due to any attribute-update this is triggered. It does not matter when the last index took place. Upon change it triggers the indexer. – tecjam May 24 '18 at 13:14
  • Depending on the size of your product collection and the server infrastructure this could take some time – tecjam May 24 '18 at 13:15
  • 1
    Yes, the queries may continue to run and take some extra time to finish after your mass update has run. – tecjam May 24 '18 at 13:36
  • 1
    it's running about one week, i guess it's not normal. pls advice how to kill them properly? – bofh May 26 '18 at 19:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.