Skip to content

Commit 4350a2e

Browse files
committed
MC-15004: Indexer hangs on category/products index
- CR feedback
1 parent 364ebfe commit 4350a2e

File tree

2 files changed

+17
-17
lines changed
  • app/code/Magento/Catalog/Model/Indexer

2 files changed

+17
-17
lines changed

app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Full.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function __construct(
110110
}
111111

112112
/**
113-
* Creates the store tables
113+
* Create the store tables
114114
*
115115
* @return void
116116
*/

app/code/Magento/Catalog/Model/Indexer/Product/Price/Action/Full.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
namespace Magento\Catalog\Model\Indexer\Product\Price\Action;
1010

11-
use Exception;
1211
use Magento\Catalog\Model\Indexer\Product\Price\AbstractAction;
1312
use Magento\Catalog\Model\Indexer\Product\Price\DimensionCollectionFactory;
1413
use Magento\Catalog\Model\Indexer\Product\Price\TableMaintainer;
@@ -37,7 +36,6 @@
3736
use Magento\Indexer\Model\ProcessManager;
3837
use Magento\Store\Model\Indexer\WebsiteDimensionProvider;
3938
use Magento\Store\Model\StoreManagerInterface;
40-
use SplFixedArray;
4139

4240
/**
4341
* Class Full reindex action
@@ -167,7 +165,7 @@ public function __construct(
167165
*
168166
* @param array|int|null $ids
169167
* @return void
170-
* @throws Exception
168+
* @throws \Exception
171169
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
172170
*/
173171
public function execute($ids = null): void
@@ -192,7 +190,7 @@ public function execute($ids = null): void
192190

193191
//Final replacement of tables from replica to main
194192
$this->switchTables();
195-
} catch (Exception $e) {
193+
} catch (\Exception $e) {
196194
throw new LocalizedException(__($e->getMessage()), $e);
197195
}
198196
}
@@ -201,7 +199,7 @@ public function execute($ids = null): void
201199
* Prepare indexer tables before full reindex
202200
*
203201
* @return void
204-
* @throws Exception
202+
* @throws \Exception
205203
*/
206204
private function prepareTables(): void
207205
{
@@ -216,7 +214,7 @@ private function prepareTables(): void
216214
* Truncate replica tables by dimensions
217215
*
218216
* @return void
219-
* @throws Exception
217+
* @throws \Exception
220218
*/
221219
private function truncateReplicaTables(): void
222220
{
@@ -233,7 +231,7 @@ private function truncateReplicaTables(): void
233231
* @param string $typeId
234232
*
235233
* @return void
236-
* @throws Exception
234+
* @throws \Exception
237235
*/
238236
private function reindexProductTypeWithDimensions(DimensionalIndexerInterface $priceIndexer, string $typeId): void
239237
{
@@ -254,7 +252,7 @@ private function reindexProductTypeWithDimensions(DimensionalIndexerInterface $p
254252
* @param string $typeId
255253
*
256254
* @return void
257-
* @throws Exception
255+
* @throws \Exception
258256
*/
259257
private function reindexByBatches(
260258
DimensionalIndexerInterface $priceIndexer,
@@ -272,7 +270,7 @@ private function reindexByBatches(
272270
* @param string $typeId
273271
*
274272
* @return BatchIterator
275-
* @throws Exception
273+
* @throws \Exception
276274
*/
277275
private function getBatchesForIndexer(string $typeId): BatchIterator
278276
{
@@ -300,7 +298,7 @@ private function getBatchesForIndexer(string $typeId): BatchIterator
300298
* @param array $dimensions
301299
*
302300
* @return void
303-
* @throws Exception
301+
* @throws \Exception
304302
*/
305303
private function reindexByBatchWithDimensions(
306304
DimensionalIndexerInterface $priceIndexer,
@@ -314,7 +312,7 @@ private function reindexByBatchWithDimensions(
314312
$temporaryTable = $this->dimensionTableMaintainer->getMainTmpTable($dimensions);
315313
$this->_emptyTable($temporaryTable);
316314

317-
$priceIndexer->executeByDimensions($dimensions, SplFixedArray::fromArray($entityIds, false));
315+
$priceIndexer->executeByDimensions($dimensions, \SplFixedArray::fromArray($entityIds, false));
318316

319317
// Sync data from temp table to index table
320318
$this->_insertFromTable(
@@ -331,7 +329,7 @@ private function reindexByBatchWithDimensions(
331329
* @param string $typeId
332330
*
333331
* @return void
334-
* @throws Exception
332+
* @throws \Exception
335333
*/
336334
private function reindexProductType(PriceInterface $priceIndexer, string $typeId): void
337335
{
@@ -346,7 +344,7 @@ private function reindexProductType(PriceInterface $priceIndexer, string $typeId
346344
* @param PriceInterface $priceIndexer
347345
* @param Select $batch
348346
* @return void
349-
* @throws Exception
347+
* @throws \Exception
350348
*/
351349
private function reindexBatch(PriceInterface $priceIndexer, Select $batch): void
352350
{
@@ -377,7 +375,7 @@ private function reindexBatch(PriceInterface $priceIndexer, Select $batch): void
377375
*
378376
* @param Select $batch
379377
* @return array
380-
* @throws Exception
378+
* @throws \Exception
381379
*/
382380
private function getEntityIdsFromBatch(Select $batch): array
383381
{
@@ -390,7 +388,7 @@ private function getEntityIdsFromBatch(Select $batch): array
390388
* Get product meta data
391389
*
392390
* @return EntityMetadataInterface
393-
* @throws Exception
391+
* @throws \Exception
394392
*/
395393
private function getProductMetaData(): EntityMetadataInterface
396394
{
@@ -405,7 +403,7 @@ private function getProductMetaData(): EntityMetadataInterface
405403
* Get replica table
406404
*
407405
* @return string
408-
* @throws Exception
406+
* @throws \Exception
409407
*/
410408
private function getReplicaTable(): string
411409
{
@@ -418,6 +416,7 @@ private function getReplicaTable(): string
418416
* Replacement of tables from replica to main
419417
*
420418
* @return void
419+
* @throws \Zend_Db_Statement_Exception
421420
*/
422421
private function switchTables(): void
423422
{
@@ -446,6 +445,7 @@ private function switchTables(): void
446445
*
447446
* @param array $dimensions
448447
* @return void
448+
* @throws \Zend_Db_Statement_Exception
449449
*/
450450
private function moveDataFromReplicaTableToReplicaTables(array $dimensions): void
451451
{

0 commit comments

Comments
 (0)