Skip to content

Commit 33d5258

Browse files
committed
fix tests
1 parent 4ec12ed commit 33d5258

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

x-pack/plugin/esql/qa/testFixtures/src/main/java/org/elasticsearch/xpack/esql/EsqlTestUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ public static Configuration configuration(QueryPragmas pragmas, String query) {
389389
false,
390390
TABLES,
391391
System.nanoTime(),
392-
randomBoolean()
392+
false
393393
);
394394
}
395395

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ void startComputeOnDataNodes(
9797
Runnable runOnTaskFailure,
9898
ActionListener<ComputeResponse> outListener
9999
) {
100-
DataNodeRequestSender sender = new DataNodeRequestSender(transportService, esqlExecutor, parentTask) {
100+
final boolean allowPartialResults = configuration.allowPartialResults();
101+
DataNodeRequestSender sender = new DataNodeRequestSender(transportService, esqlExecutor, parentTask, allowPartialResults) {
101102
@Override
102103
protected void sendRequest(
103104
DiscoveryNode node,

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,18 @@ abstract class DataNodeRequestSender {
5353
private final TransportService transportService;
5454
private final Executor esqlExecutor;
5555
private final CancellableTask rootTask;
56+
private final boolean allowPartialResults;
5657
private final ReentrantLock sendingLock = new ReentrantLock();
5758
private final Queue<ShardId> pendingShardIds = ConcurrentCollections.newQueue();
5859
private final Map<DiscoveryNode, Semaphore> nodePermits = new HashMap<>();
5960
private final Map<ShardId, ShardFailure> shardFailures = ConcurrentCollections.newConcurrentMap();
6061
private final AtomicBoolean changed = new AtomicBoolean();
6162

62-
DataNodeRequestSender(TransportService transportService, Executor esqlExecutor, CancellableTask rootTask) {
63+
DataNodeRequestSender(TransportService transportService, Executor esqlExecutor, CancellableTask rootTask, boolean allowPartialResults) {
6364
this.transportService = transportService;
6465
this.esqlExecutor = esqlExecutor;
6566
this.rootTask = rootTask;
67+
this.allowPartialResults = allowPartialResults;
6668
}
6769

6870
final void startComputeOnDataNodes(
@@ -328,7 +330,7 @@ void searchShards(
328330
filter,
329331
null,
330332
null,
331-
true,
333+
true, // unavailable_shards will be handled by the sender
332334
clusterAlias
333335
);
334336
transportService.sendChildRequest(

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/plugin/DataNodeRequestSenderTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ PlainActionFuture<ComputeResponse> sendRequests(List<DataNodeRequestSender.Targe
236236
TaskId.EMPTY_TASK_ID,
237237
Collections.emptyMap()
238238
);
239-
DataNodeRequestSender requestSender = new DataNodeRequestSender(transportService, executor, task) {
239+
DataNodeRequestSender requestSender = new DataNodeRequestSender(transportService, executor, task, false) {
240240
@Override
241241
void searchShards(
242242
Task parentTask,

0 commit comments

Comments
 (0)