Skip to content

Commit 0cc494a

Browse files
authored
Merge branch 'main' into fix/bulk-pipeline
2 parents e0ee15f + 59f9837 commit 0cc494a

File tree

6 files changed

+17
-10
lines changed

6 files changed

+17
-10
lines changed

modules/reindex/src/main/java/org/elasticsearch/reindex/ReindexPlugin.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.elasticsearch.common.settings.Setting;
2020
import org.elasticsearch.common.settings.Settings;
2121
import org.elasticsearch.common.settings.SettingsFilter;
22+
import org.elasticsearch.common.util.FeatureFlag;
2223
import org.elasticsearch.features.NodeFeature;
2324
import org.elasticsearch.index.reindex.BulkByScrollTask;
2425
import org.elasticsearch.index.reindex.DeleteByQueryAction;
@@ -44,6 +45,11 @@ public class ReindexPlugin extends Plugin implements ActionPlugin {
4445

4546
public static final ActionType<ListTasksResponse> RETHROTTLE_ACTION = new ActionType<>("cluster:admin/reindex/rethrottle");
4647

48+
/**
49+
* Whether the feature flag to guard the work to make reindex more resilient while it is under development.
50+
*/
51+
static boolean REINDEX_RESILIENCE_ENABLED = new FeatureFlag("reindex_resilience").isEnabled();
52+
4753
@Override
4854
public List<ActionHandler> getActions() {
4955
return Arrays.asList(

muted-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,9 @@ tests:
447447
- class: org.elasticsearch.test.rest.yaml.CcsCommonYamlTestSuiteIT
448448
method: test {p0=scroll/20_keep_alive/Max keep alive}
449449
issue: https://github.com/elastic/elasticsearch/issues/138680
450+
- class: org.elasticsearch.xpack.unsignedlong.UnsignedLongSyntheticSourceNativeArrayIntegrationTests
451+
method: testSynthesizeArrayRandom
452+
issue: https://github.com/elastic/elasticsearch/issues/138684
450453

451454
# Examples:
452455
#

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/enrich/LookupFromIndexService.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,7 @@ protected LookupEnrichQueryGenerator queryList(
148148
* In those cases, it is safe to ignore the plan sent and return null
149149
*/
150150
private static PhysicalPlan localLookupNodePlanning(PhysicalPlan physicalPlan) {
151-
if (physicalPlan instanceof FragmentExec fragmentExec) {
152-
LocalMapper localMapper = new LocalMapper();
153-
return localMapper.map(fragmentExec.fragment());
154-
}
155-
return null;
151+
return physicalPlan instanceof FragmentExec fragmentExec ? LocalMapper.INSTANCE.map(fragmentExec.fragment()) : null;
156152
}
157153

158154
@Override

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/PlannerUtils.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,8 @@ public static PlanReduction reductionPlan(PhysicalPlan plan) {
144144
return SimplePlanReduction.NO_REDUCTION;
145145
}
146146
final LogicalPlan pipelineBreaker = pipelineBreakers.getFirst();
147-
final LocalMapper mapper = new LocalMapper();
148147
int estimatedRowSize = fragment.estimatedRowSize();
149-
return switch (mapper.map(pipelineBreaker)) {
148+
return switch (LocalMapper.INSTANCE.map(pipelineBreaker)) {
150149
case TopNExec topN -> new TopNReduction(EstimatesRowSize.estimateRowSize(estimatedRowSize, topN));
151150
case AggregateExec aggExec -> getPhysicalPlanReduction(estimatedRowSize, aggExec.withMode(AggregatorMode.INTERMEDIATE));
152151
case PhysicalPlan p -> getPhysicalPlanReduction(estimatedRowSize, p);
@@ -218,7 +217,6 @@ public static PhysicalPlan localPlan(
218217
LocalLogicalPlanOptimizer logicalOptimizer,
219218
LocalPhysicalPlanOptimizer physicalOptimizer
220219
) {
221-
final LocalMapper localMapper = new LocalMapper();
222220
var isCoordPlan = new Holder<>(Boolean.TRUE);
223221
Set<PhysicalPlan> lookupJoinExecRightChildren = plan.collect(LookupJoinExec.class::isInstance)
224222
.stream()
@@ -234,7 +232,7 @@ public static PhysicalPlan localPlan(
234232
}
235233
isCoordPlan.set(Boolean.FALSE);
236234
LogicalPlan optimizedFragment = logicalOptimizer.localOptimize(f.fragment());
237-
PhysicalPlan physicalFragment = localMapper.map(optimizedFragment);
235+
PhysicalPlan physicalFragment = LocalMapper.INSTANCE.map(optimizedFragment);
238236
QueryBuilder filter = f.esFilter();
239237
if (filter != null) {
240238
physicalFragment = physicalFragment.transformUp(

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/mapper/LocalMapper.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
*/
4242
public class LocalMapper {
4343

44+
public static LocalMapper INSTANCE = new LocalMapper();
45+
46+
private LocalMapper() {}
47+
4448
public PhysicalPlan map(LogicalPlan p) {
4549

4650
if (p instanceof LeafPlan leaf) {

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/LateMaterializationPlanner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public static Optional<ReductionPlan> planReduceDriverTopN(
133133
}
134134

135135
private static PhysicalPlan toPhysical(LogicalPlan plan, LocalPhysicalOptimizerContext context) {
136-
return new InsertFieldExtraction().apply(new ReplaceSourceAttributes().apply(new LocalMapper().map(plan)), context);
136+
return new InsertFieldExtraction().apply(new ReplaceSourceAttributes().apply(LocalMapper.INSTANCE.map(plan)), context);
137137
}
138138

139139
private LateMaterializationPlanner() { /* static class */ }

0 commit comments

Comments
 (0)