From c18b6d09ff370e7fd364eaefa7a9cdbbce6bfd86 Mon Sep 17 00:00:00 2001 From: Przemyslaw Witek Date: Fri, 22 Sep 2023 11:59:17 +0200 Subject: [PATCH] [Transform] Do not use PIT in the presence of remote indices in source --- .../xpack/transform/transforms/ClientTransformIndexer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/transforms/ClientTransformIndexer.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/transforms/ClientTransformIndexer.java index b3373eac02968..00fa7f200a3c3 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/transforms/ClientTransformIndexer.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/transforms/ClientTransformIndexer.java @@ -146,7 +146,7 @@ protected void doNextSearch(long waitTimeInNanos, ActionListener injectPointInTimeIfNeeded( buildSearchRequest(), - ActionListener.wrap(pitSearchRequest -> doSearch(pitSearchRequest, nextPhase), nextPhase::onFailure) + ActionListener.wrap(searchRequest -> doSearch(searchRequest, nextPhase), nextPhase::onFailure) ); } @@ -435,7 +435,8 @@ private void injectPointInTimeIfNeeded( ActionListener> listener ) { SearchRequest searchRequest = namedSearchRequest.v2(); - if (disablePit || searchRequest.indices().length == 0) { + // We explicitly disable PIT in the presence of remote clusters in the source due to huge PIT handles causing performance problems. + if (disablePit || searchRequest.indices().length == 0 || transformConfig.getSource().requiresRemoteCluster()) { listener.onResponse(namedSearchRequest); return; }