Closed
Description
Preconditions (*)
- Magento Version 2.2.5
- 4000 products,
- 41 stores
- 42 store groups,
- 6 websites,
Steps to reproduce (*)
- Programatically reindex a limited set of products with the following,
$productIndexer = $this->indexerRegistry->get(\Magento\Catalog\Model\Indexer\Product\Eav\Processor::INDEXER_ID);
$category = $this->categoryRepository->get(
$categoryId,
$storeId
);
$productCollection = $category->getProductCollection();
$productIds = $productCollection->getAllIds();
$productIndexer->reindexList($productIds);
Expected result (*)
- Reindex to be successfully completed,
Actual result (*)
- Error given:
The table 'catalog_product_index_eav_temp' is full
After diving into the issue I noticed that calling $productIndexer->reindexAll();
does not have this problem. It looks like the built in batch processing only happens when reindexing all products and not a sub set.
For full indexing see: https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Catalog/Model/Indexer/Product/Eav/Action/Full.php#L112
For partial indexing see: https://github.com/magento/magento2/blob/2.3-develop/app/code/Magento/Catalog/Model/Indexer/Product/Eav/Action/Rows.php#L21
For our case I have added our own batch processing around the reindexList
call but I wonder if this is something that should be taken over by the Magento index batching that already gets used.