Skip to content

Commit fbd4f66

Browse files
author
Stanislav Idolov
committed
MAGETWO-67566: Add additional information into warning message in BatchSizeManagement
1 parent ae28a7a commit fbd4f66

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

lib/internal/Magento/Framework/Indexer/BatchSizeManagement.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ public function ensureBatchSize(\Magento\Framework\DB\Adapter\AdapterInterface $
5050

5151
// Log warning if allocated memory for temp table greater than 20% of innodb_buffer_pool_size
5252
if ($size > $bufferPoolSize * .2) {
53-
$this->logger->warning(new \Magento\Framework\Phrase(
54-
'Memory size allocated for the temporary table is more than 20% of innodb_buffer_pool_size. ' .
53+
$message = 'Memory size allocated for the temporary table is more than 20% of innodb_buffer_pool_size. ' .
5554
'Please update innodb_buffer_pool_size or decrease batch size value '.
56-
'(which decreases memory usages for the temporary table).'
57-
));
55+
'(which decreases memory usages for the temporary table). ' .
56+
'Current batch size: %1; Allocated memory size: %2 bytes; InnoDB buffer pool size: %3 bytes.';
57+
$this->logger->warning(new \Magento\Framework\Phrase($message, [$batchSize, $size, $bufferPoolSize]));
5858
}
5959

6060
if ($maxMemoryTableSize < $size) {

lib/internal/Magento/Framework/Indexer/Test/Unit/BatchSizeManagementTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,11 @@ public function testEnsureBatchSize()
6060
$this->loggerMock->expects($this->once())
6161
->method('warning')
6262
->with(__(
63-
'Memory size allocated for the temporary table is more than 20% of innodb_buffer_pool_size. ' .
64-
'Please update innodb_buffer_pool_size or decrease batch size value '.
65-
'(which decreases memory usages for the temporary table).'
63+
"Memory size allocated for the temporary table is more than 20% of innodb_buffer_pool_size. " .
64+
"Please update innodb_buffer_pool_size or decrease batch size value ".
65+
"(which decreases memory usages for the temporary table). ".
66+
"Current batch size: %1; Allocated memory size: %2 bytes; InnoDB buffer pool size: %3 bytes.",
67+
[$batchSize, $size, $innodbPollSize]
6668
));
6769

6870
$adapterMock->expects($this->at(3))

0 commit comments

Comments
 (0)