Skip to content

Commit e4e1ae3

Browse files
ENGCOM-5834: Fix elastic alias doubled index if exception was thrown #24552
2 parents 35ab7e2 + 6c03839 commit e4e1ae3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/code/Magento/Elasticsearch/Model/Adapter/Elasticsearch.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ public function addDocs(array $documents, $storeId, $mappedIndexerId)
193193
*/
194194
public function cleanIndex($storeId, $mappedIndexerId)
195195
{
196+
// needed to fix bug with double indices in alias because of second reindex in same process
197+
unset($this->preparedIndex[$storeId]);
198+
196199
$this->checkIndex($storeId, $mappedIndexerId, true);
197200
$indexName = $this->indexNameResolver->getIndexName($storeId, $mappedIndexerId, $this->preparedIndex);
198201

0 commit comments

Comments
 (0)