Skip to content

Commit f20c464

Browse files
author
Michail Slabko
committed
MAGETWO-23764: Category/Product Indexer fails with mysql fatal on large catalog
- fix static tests
1 parent 0e6cc05 commit f20c464

File tree

2 files changed

+63
-61
lines changed

2 files changed

+63
-61
lines changed

app/code/Magento/Catalog/Model/ResourceModel/MaxHeapTableSizeProcessor.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public function __construct(ResourceConnection $resource)
4343
* @param int|null $maxHeapTableSize
4444
* @throws \InvalidArgumentException
4545
* @throws \RuntimeException
46+
* @return void
4647
*/
4748
public function set($maxHeapTableSize = null)
4849
{
@@ -63,6 +64,7 @@ public function set($maxHeapTableSize = null)
6364
* Restore max_heap_table_size value
6465
*
6566
* @throws \RuntimeException
67+
* @return void
6668
*/
6769
public function restore()
6870
{
Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,61 @@
1-
<?php
2-
/**
3-
* Copyright © 2015 Magento. All rights reserved.
4-
* See COPYING.txt for license details.
5-
*/
6-
7-
namespace Magento\Catalog\Plugin\Model\Indexer\Category\Product;
8-
9-
use Magento\Catalog\Model\Indexer\Category\Product\Action\Full;
10-
use Magento\Catalog\Model\ResourceModel\MaxHeapTableSizeProcessor;
11-
use Psr\Log\LoggerInterface;
12-
13-
class MaxHeapTableSizeProcessorOnFullReindex
14-
{
15-
/**
16-
* @var MaxHeapTableSizeProcessor
17-
*/
18-
protected $maxHeapTableSizeProcessor;
19-
20-
/**
21-
* @param MaxHeapTableSizeProcessor $maxHeapTableSizeProcessor
22-
* @param LoggerInterface $logger
23-
*/
24-
public function __construct(
25-
MaxHeapTableSizeProcessor $maxHeapTableSizeProcessor,
26-
LoggerInterface $logger
27-
) {
28-
$this->maxHeapTableSizeProcessor = $maxHeapTableSizeProcessor;
29-
$this->logger = $logger;
30-
}
31-
32-
/**
33-
* @param Full $subject
34-
* @return void
35-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
36-
*/
37-
public function beforeExecute(Full $subject)
38-
{
39-
try {
40-
$this->maxHeapTableSizeProcessor->set();
41-
} catch (\Exception $e) {
42-
$this->logger->error($e);
43-
}
44-
}
45-
46-
/**
47-
* @param Full $subject
48-
* @param Full $result
49-
* @return Full
50-
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
51-
*/
52-
public function afterExecute(Full $subject, Full $result)
53-
{
54-
try {
55-
$this->maxHeapTableSizeProcessor->restore();
56-
} catch (\Exception $e) {
57-
$this->logger->error($e);
58-
}
59-
return $result;
60-
}
61-
}
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Catalog\Plugin\Model\Indexer\Category\Product;
8+
9+
use Magento\Catalog\Model\Indexer\Category\Product\Action\Full;
10+
use Magento\Catalog\Model\ResourceModel\MaxHeapTableSizeProcessor;
11+
use Psr\Log\LoggerInterface;
12+
13+
class MaxHeapTableSizeProcessorOnFullReindex
14+
{
15+
/**
16+
* @var MaxHeapTableSizeProcessor
17+
*/
18+
protected $maxHeapTableSizeProcessor;
19+
20+
/**
21+
* @param MaxHeapTableSizeProcessor $maxHeapTableSizeProcessor
22+
* @param LoggerInterface $logger
23+
*/
24+
public function __construct(
25+
MaxHeapTableSizeProcessor $maxHeapTableSizeProcessor,
26+
LoggerInterface $logger
27+
) {
28+
$this->maxHeapTableSizeProcessor = $maxHeapTableSizeProcessor;
29+
$this->logger = $logger;
30+
}
31+
32+
/**
33+
* @param Full $subject
34+
* @return void
35+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
36+
*/
37+
public function beforeExecute(Full $subject)
38+
{
39+
try {
40+
$this->maxHeapTableSizeProcessor->set();
41+
} catch (\Exception $e) {
42+
$this->logger->error($e);
43+
}
44+
}
45+
46+
/**
47+
* @param Full $subject
48+
* @param Full $result
49+
* @return Full
50+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
51+
*/
52+
public function afterExecute(Full $subject, Full $result)
53+
{
54+
try {
55+
$this->maxHeapTableSizeProcessor->restore();
56+
} catch (\Exception $e) {
57+
$this->logger->error($e);
58+
}
59+
return $result;
60+
}
61+
}

0 commit comments

Comments
 (0)