From 764de93b6f95ab06ce85e0e2a42dd76292f97b44 Mon Sep 17 00:00:00 2001 From: Felix Gradinaru Date: Mon, 2 Jun 2025 14:23:14 +0200 Subject: [PATCH] BUGFIX: Retry on conflict also in fulltext method --- Classes/Driver/Version6/IndexerDriver.php | 11 +++++++++-- Configuration/Settings.yaml | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Classes/Driver/Version6/IndexerDriver.php b/Classes/Driver/Version6/IndexerDriver.php index f0fd7a4c..327f14f5 100644 --- a/Classes/Driver/Version6/IndexerDriver.php +++ b/Classes/Driver/Version6/IndexerDriver.php @@ -28,6 +28,11 @@ */ class IndexerDriver extends AbstractIndexerDriver implements IndexerDriverInterface { + /** + * @Flow\InjectConfiguration(path="indexing.retryOnConflict") + * @var int + */ + protected $retryOnConflict = 3; /** * {@inheritdoc} @@ -43,7 +48,7 @@ public function document(string $indexName, NodeInterface $node, ElasticSearchDo 'update' => [ '_id' => $document->getId(), '_index' => $indexName, - 'retry_on_conflict' => 3 + 'retry_on_conflict' => $this->retryOnConflict ?: 3 ] ], // https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-update.html @@ -71,6 +76,7 @@ public function document(string $indexName, NodeInterface $node, ElasticSearchDo 'index' => [ '_id' => $document->getId(), '_index' => $indexName, + 'retry_on_conflict' => $this->retryOnConflict ?: 3 ] ], $documentData @@ -108,7 +114,8 @@ public function fulltext(NodeInterface $node, array $fulltextIndexOfNode, ?strin return [ [ 'update' => [ - '_id' => $closestFulltextNodeDocumentIdentifier + '_id' => $closestFulltextNodeDocumentIdentifier, + 'retry_on_conflict' => $this->retryOnConflict ?: 3 ] ], // https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html diff --git a/Configuration/Settings.yaml b/Configuration/Settings.yaml index eb701b8d..62800af4 100644 --- a/Configuration/Settings.yaml +++ b/Configuration/Settings.yaml @@ -4,6 +4,7 @@ Flowpack: command: useSubProcesses: true indexing: + retryOnConflict: 3 batchSize: elements: 500 octets: 40000000