Skip to content

Commit 755f346

Browse files
committed
MAGE-721 Remove tmp index replica operations as they are incompatible with index move ops
1 parent f8c75b4 commit 755f346

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

Helper/ConfigHelper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,7 @@ protected function isGroupPricingExcludedFromWebsite(int $customerGroupId, int $
10161016
/**
10171017
* Augment sorting configuration with corresponding replica indices, ranking,
10181018
* and (as needed) customer group pricing
1019+
* TODO: MAGE-941 Remove the $originalIndexName param - this should never be needed as tmp indices cannot have attached replicas
10191020
*
10201021
* @param string $originalIndexName
10211022
* @param ?int $storeId

Helper/Entity/ProductHelper.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -373,18 +373,14 @@ public function setSettings(string $indexName, string $indexNameTmp, int $storeI
373373
}
374374

375375
$this->replicaManager->handleReplicas($indexName, $storeId, $indexSettings);
376-
// TODO: Reevaluate whether we need to pre-bake the temp index replicas
377-
if ($saveToTmpIndicesToo) {
378-
$this->replicaManager->handleReplicas($indexNameTmp, $storeId, $indexSettings);
379-
}
380376

381377
if ($saveToTmpIndicesToo) {
382378
try {
383379
$this->algoliaHelper->copySynonyms($indexName, $indexNameTmp);
384380
$this->algoliaHelper->waitLastTask();
385381
$this->logger->log('
386-
Copying synonyms from production index to "' . $indexNameTmp . '" to not erase them with the index move.
387-
');
382+
Copying synonyms from production index to "' . $indexNameTmp . '" to not erase them with the index move.
383+
');
388384
} catch (AlgoliaException $e) {
389385
$this->logger->error('Error encountered while copying synonyms: ' . $e->getMessage());
390386
}
@@ -393,8 +389,8 @@ public function setSettings(string $indexName, string $indexNameTmp, int $storeI
393389
$this->algoliaHelper->copyQueryRules($indexName, $indexNameTmp);
394390
$this->algoliaHelper->waitLastTask();
395391
$this->logger->log('
396-
Copying query rules from production index to "' . $indexNameTmp . '" to not erase them with the index move.
397-
');
392+
Copying query rules from production index to "' . $indexNameTmp . '" to not erase them with the index move.
393+
');
398394
} catch (AlgoliaException $e) {
399395
if ($e->getCode() !== 404) {
400396
throw $e;

0 commit comments

Comments
 (0)