Skip to content

Commit 102da20

Browse files
Merge remote-tracking branch 'origin/main' into feature/mistral-chat-completion-integration
2 parents 68a5432 + aa0a829 commit 102da20

File tree

10 files changed

+205
-44
lines changed

10 files changed

+205
-44
lines changed

docs/reference/query-languages/query-dsl/query-dsl-minimum-should-match.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ The `minimum_should_match` parameter’s possible values:
99

1010
| Type | Example | Description |
1111
| --- | --- | --- |
12-
| Integer | `3` | Indicates a fixed value regardless of the number ofoptional clauses. |
13-
| Negative integer | `-2` | Indicates that the total number of optionalclauses, minus this number should be mandatory. |
14-
| Percentage | `75%` | Indicates that this percent of the total number ofoptional clauses are necessary. The number computed from the percentageis rounded down and used as the minimum. |
15-
| Negative percentage | `-25%` | Indicates that this percent of the totalnumber of optional clauses can be missing. The number computed from thepercentage is rounded down, before being subtracted from the total todetermine the minimum. |
16-
| Combination | `3<90%` | A positive integer, followed by the less-thansymbol, followed by any of the previously mentioned specifiers is aconditional specification. It indicates that if the number of optionalclauses is equal to (or less than) the integer, they are all required,but if it’s greater than the integer, the specification applies. In thisexample: if there are 1 to 3 clauses they are all required, but for 4 ormore clauses only 90% are required. |
17-
| Multiple combinations | `2<-25% 9<-3` | Multiple conditionalspecifications can be separated by spaces, each one only being valid fornumbers greater than the one before it. In this example: if there are 1or 2 clauses both are required, if there are 3-9 clauses all but 25% arerequired, and if there are more than 9 clauses, all but three arerequired. |
12+
| Integer | `3` | Indicates a fixed value regardless of the number of optional clauses. |
13+
| Negative integer | `-2` | Indicates that the total number of optional clauses, minus this number should be mandatory. |
14+
| Percentage | `75%` | Indicates that this percent of the total number of optional clauses are necessary. The number computed from the percentage is rounded down and used as the minimum. |
15+
| Negative percentage | `-25%` | Indicates that this percent of the total number of optional clauses can be missing. The number computed from the percentage is rounded down, before being subtracted from the total to determine the minimum. |
16+
| Combination | `3<90%` | A positive integer, followed by the less-than symbol, followed by any of the previously mentioned specifiers is aconditional specification. It indicates that if the number of optional clauses is equal to (or less than) the integer, they are all required, but if it’s greater than the integer, the specification applies. In this example: if there are 1 to 3 clauses they are all required, but for 4 or more clauses only 90% are required. |
17+
| Multiple combinations | `2<-25% 9<-3` | Multiple conditional specifications can be separated by spaces, each one only being valid for numbers greater than the one before it. In this example: if there are 1 or 2 clauses both are required, if there are 3-9 clauses all but 25% are required, and if there are more than 9 clauses, all but three are required. |
1818

1919
**NOTE:**
2020

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,6 @@ tests:
204204
- class: org.elasticsearch.packaging.test.DockerTests
205205
method: test151MachineDependentHeapWithSizeOverride
206206
issue: https://github.com/elastic/elasticsearch/issues/123437
207-
- class: org.elasticsearch.action.admin.cluster.node.tasks.CancellableTasksIT
208-
method: testChildrenTasksCancelledOnTimeout
209-
issue: https://github.com/elastic/elasticsearch/issues/123568
210207
- class: org.elasticsearch.xpack.searchablesnapshots.FrozenSearchableSnapshotsIntegTests
211208
method: testCreateAndRestorePartialSearchableSnapshot
212209
issue: https://github.com/elastic/elasticsearch/issues/123773

server/src/internalClusterTest/java/org/elasticsearch/action/admin/cluster/node/tasks/CancellableTasksIT.java

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import org.elasticsearch.action.ActionRequestValidationException;
1818
import org.elasticsearch.action.ActionResponse;
1919
import org.elasticsearch.action.ActionType;
20+
import org.elasticsearch.action.DelegatingActionListener;
2021
import org.elasticsearch.action.LatchedActionListener;
2122
import org.elasticsearch.action.LegacyActionRequest;
2223
import org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse;
@@ -26,6 +27,7 @@
2627
import org.elasticsearch.action.support.PlainActionFuture;
2728
import org.elasticsearch.client.internal.node.NodeClient;
2829
import org.elasticsearch.cluster.node.DiscoveryNode;
30+
import org.elasticsearch.common.Strings;
2931
import org.elasticsearch.common.io.stream.StreamInput;
3032
import org.elasticsearch.common.io.stream.StreamOutput;
3133
import org.elasticsearch.common.util.CollectionUtils;
@@ -34,6 +36,8 @@
3436
import org.elasticsearch.common.util.set.Sets;
3537
import org.elasticsearch.core.TimeValue;
3638
import org.elasticsearch.injection.guice.Inject;
39+
import org.elasticsearch.logging.LogManager;
40+
import org.elasticsearch.logging.Logger;
3741
import org.elasticsearch.plugins.ActionPlugin;
3842
import org.elasticsearch.plugins.Plugin;
3943
import org.elasticsearch.tasks.CancellableTask;
@@ -43,6 +47,7 @@
4347
import org.elasticsearch.tasks.TaskInfo;
4448
import org.elasticsearch.tasks.TaskManager;
4549
import org.elasticsearch.test.ESIntegTestCase;
50+
import org.elasticsearch.test.junit.annotations.TestIssueLogging;
4651
import org.elasticsearch.threadpool.ThreadPool;
4752
import org.elasticsearch.transport.ReceiveTimeoutTransportException;
4853
import org.elasticsearch.transport.SendRequestTransportException;
@@ -74,6 +79,9 @@
7479
@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST)
7580
public class CancellableTasksIT extends ESIntegTestCase {
7681

82+
// Temporary addition for investigation into https://github.com/elastic/elasticsearch/issues/123568
83+
private static final Logger logger = LogManager.getLogger(CancellableTasksIT.class);
84+
7785
static int idGenerator = 0;
7886
static final Map<TestRequest, CountDownLatch> beforeSendLatches = ConcurrentCollections.newConcurrentMap();
7987
static final Map<TestRequest, CountDownLatch> arrivedLatches = ConcurrentCollections.newConcurrentMap();
@@ -366,18 +374,42 @@ public void testRemoveBanParentsOnDisconnect() throws Exception {
366374
}
367375
}
368376

377+
@TestIssueLogging(
378+
issueUrl = "https://github.com/elastic/elasticsearch/issues/123568",
379+
value = "org.elasticsearch.transport.TransportService.tracer:TRACE"
380+
+ ",org.elasticsearch.tasks.TaskManager:TRACE"
381+
+ ",org.elasticsearch.action.admin.cluster.node.tasks.CancellableTasksIT:DEBUG"
382+
)
369383
public void testChildrenTasksCancelledOnTimeout() throws Exception {
370384
Set<DiscoveryNode> nodes = clusterService().state().nodes().stream().collect(Collectors.toSet());
371385
final TestRequest rootRequest = generateTestRequest(nodes, 0, between(1, 4), true);
386+
logger.info("generated request\n{}", buildTestRequestDescription(rootRequest, "", new StringBuilder()).toString());
372387
ActionFuture<TestResponse> rootTaskFuture = client().execute(TransportTestAction.ACTION, rootRequest);
388+
logger.info("action executed");
373389
allowEntireRequest(rootRequest);
390+
logger.info("execution released");
374391
waitForRootTask(rootTaskFuture, true);
392+
logger.info("root task completed");
375393
ensureBansAndCancellationsConsistency();
394+
logger.info("ensureBansAndCancellationsConsistency completed");
376395

377396
// Make sure all descendent requests have completed
378397
for (TestRequest subRequest : rootRequest.descendants()) {
398+
logger.info("awaiting completion of request {}", subRequest.getDescription());
379399
safeAwait(completedLatches.get(subRequest));
380400
}
401+
logger.info("all requests completed");
402+
}
403+
404+
// Temporary addition for investigation into https://github.com/elastic/elasticsearch/issues/123568
405+
static StringBuilder buildTestRequestDescription(TestRequest request, String prefix, StringBuilder stringBuilder) {
406+
stringBuilder.append(prefix)
407+
.append(Strings.format("id=%d [timeout=%s] %s", request.id, request.timeout, request.node.descriptionWithoutAttributes()))
408+
.append('\n');
409+
for (TestRequest subRequest : request.subRequests) {
410+
buildTestRequestDescription(subRequest, prefix + " ", stringBuilder);
411+
}
412+
return stringBuilder;
381413
}
382414

383415
static TaskId getRootTaskId(TestRequest request) throws Exception {
@@ -506,6 +538,8 @@ public void writeTo(StreamOutput out) throws IOException {
506538

507539
public static class TransportTestAction extends HandledTransportAction<TestRequest, TestResponse> {
508540

541+
private static final Logger logger = CancellableTasksIT.logger;
542+
509543
public static ActionType<TestResponse> ACTION = new ActionType<>("internal::test_action");
510544
private final TransportService transportService;
511545
private final NodeClient client;
@@ -565,7 +599,22 @@ protected void doExecute(Task task, TestRequest request, ActionListener<TestResp
565599
protected void startSubTask(TaskId parentTaskId, TestRequest subRequest, ActionListener<TestResponse> listener) {
566600
subRequest.setParentTask(parentTaskId);
567601
CountDownLatch completeLatch = completedLatches.get(subRequest);
568-
LatchedActionListener<TestResponse> latchedListener = new LatchedActionListener<>(listener, completeLatch);
602+
ActionListener<TestResponse> latchedListener = new DelegatingActionListener<>(
603+
new LatchedActionListener<>(listener, completeLatch)
604+
) {
605+
// Temporary logging addition for investigation into https://github.com/elastic/elasticsearch/issues/123568
606+
@Override
607+
public void onResponse(TestResponse testResponse) {
608+
logger.debug("processing successful response to request [{}]", subRequest.getDescription());
609+
delegate.onResponse(testResponse);
610+
}
611+
612+
@Override
613+
public void onFailure(Exception e) {
614+
logger.debug("processing exceptional response to request [{}]: {}", subRequest.getDescription(), e.getMessage());
615+
super.onFailure(e);
616+
}
617+
};
569618
transportService.getThreadPool().generic().execute(new AbstractRunnable() {
570619
@Override
571620
public void onFailure(Exception e) {
@@ -596,6 +645,13 @@ protected void doRun() throws Exception {
596645
TransportResponseHandler.TRANSPORT_WORKER
597646
)
598647
);
648+
// Temporary addition for investigation into https://github.com/elastic/elasticsearch/issues/123568
649+
logger.debug(
650+
"sent test request [{}] from [{}] to [{}]",
651+
subRequest.getDescription(),
652+
client.getLocalNodeId(),
653+
subRequest.node.descriptionWithoutAttributes()
654+
);
599655
}
600656
}
601657
});

x-pack/plugin/esql/qa/server/multi-clusters/src/javaRestTest/java/org/elasticsearch/xpack/esql/ccq/MultiClusterSpecIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
import static org.elasticsearch.xpack.esql.CsvTestUtils.isEnabled;
4747
import static org.elasticsearch.xpack.esql.CsvTestsDataLoader.ENRICH_SOURCE_INDICES;
4848
import static org.elasticsearch.xpack.esql.EsqlTestUtils.classpathResources;
49-
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.FORK_V5;
49+
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.FORK_V6;
5050
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.INLINESTATS;
5151
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.INLINESTATS_V2;
5252
import static org.elasticsearch.xpack.esql.action.EsqlCapabilities.Cap.INLINESTATS_V7;
@@ -132,7 +132,7 @@ protected void shouldSkipTest(String testName) throws IOException {
132132
assumeFalse("LOOKUP JOIN not yet supported in CCS", testCase.requiredCapabilities.contains(JOIN_LOOKUP_V12.capabilityName()));
133133
// Unmapped fields require a coorect capability response from every cluster, which isn't currently implemented.
134134
assumeFalse("UNMAPPED FIELDS not yet supported in CCS", testCase.requiredCapabilities.contains(UNMAPPED_FIELDS.capabilityName()));
135-
assumeFalse("FORK not yet supported in CCS", testCase.requiredCapabilities.contains(FORK_V5.capabilityName()));
135+
assumeFalse("FORK not yet supported in CCS", testCase.requiredCapabilities.contains(FORK_V6.capabilityName()));
136136
}
137137

138138
@Override

x-pack/plugin/esql/qa/testFixtures/src/main/resources/fork.csv-spec

Lines changed: 54 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44

55
simpleFork
6-
required_capability: fork_v5
6+
required_capability: fork_v6
77

88
FROM employees
99
| FORK ( WHERE emp_no == 10001 )
@@ -18,7 +18,7 @@ emp_no:integer | _fork:keyword
1818
;
1919

2020
forkWithWhereSortAndLimit
21-
required_capability: fork_v5
21+
required_capability: fork_v6
2222

2323
FROM employees
2424
| FORK ( WHERE hire_date < "1985-03-01T00:00:00Z" | SORT first_name | LIMIT 5 )
@@ -38,7 +38,7 @@ emp_no:integer | first_name:keyword | _fork:keyword
3838
;
3939

4040
fiveFork
41-
required_capability: fork_v5
41+
required_capability: fork_v6
4242

4343
FROM employees
4444
| FORK ( WHERE emp_no == 10005 )
@@ -59,7 +59,7 @@ fork5 | 10001
5959
;
6060

6161
forkWithWhereSortDescAndLimit
62-
required_capability: fork_v5
62+
required_capability: fork_v6
6363

6464
FROM employees
6565
| FORK ( WHERE hire_date < "1985-03-01T00:00:00Z" | SORT first_name DESC | LIMIT 2 )
@@ -76,7 +76,7 @@ fork2 | 10087 | Xinglin
7676
;
7777

7878
forkWithCommonPrefilter
79-
required_capability: fork_v5
79+
required_capability: fork_v6
8080

8181
FROM employees
8282
| WHERE emp_no > 10050
@@ -94,7 +94,7 @@ fork2 | 10100
9494
;
9595

9696
forkWithSemanticSearchAndScore
97-
required_capability: fork_v5
97+
required_capability: fork_v6
9898
required_capability: semantic_text_field_caps
9999
required_capability: metadata_score
100100

@@ -114,7 +114,7 @@ fork2 | 6.093784261960139E18 | 2 | all we have to decide is w
114114
;
115115

116116
forkWithEvals
117-
required_capability: fork_v5
117+
required_capability: fork_v6
118118

119119
FROM employees
120120
| FORK (WHERE emp_no == 10048 OR emp_no == 10081 | EVAL x = "abc" | EVAL y = 1)
@@ -131,7 +131,7 @@ fork2 | 10087 | def | null | 2
131131
;
132132

133133
forkWithStats
134-
required_capability: fork_v5
134+
required_capability: fork_v6
135135

136136
FROM employees
137137
| FORK (WHERE emp_no == 10048 OR emp_no == 10081)
@@ -152,7 +152,7 @@ fork4 | null | 100 | 10001 | null
152152
;
153153

154154
forkWithDissect
155-
required_capability: fork_v5
155+
required_capability: fork_v6
156156

157157
FROM employees
158158
| WHERE emp_no == 10048 OR emp_no == 10081
@@ -172,7 +172,7 @@ fork2 | 10081 | Rosen | 10081 | null | Zhongwei
172172
;
173173

174174
forkWithMixOfCommands
175-
required_capability: fork_v5
175+
required_capability: fork_v6
176176

177177
FROM employees
178178
| WHERE emp_no == 10048 OR emp_no == 10081
@@ -197,7 +197,7 @@ fork4 | 10081 | abc | aaa | null | null
197197
;
198198

199199
forkWithFiltersOnConstantValues
200-
required_capability: fork_v5
200+
required_capability: fork_v6
201201

202202
FROM employees
203203
| EVAL z = 1
@@ -218,7 +218,7 @@ fork3 | null | 100 | 10100 | 10001
218218
;
219219

220220
forkWithUnsupportedAttributes
221-
required_capability: fork_v5
221+
required_capability: fork_v6
222222

223223
FROM heights
224224
| FORK (SORT description DESC | LIMIT 1 | EVAL x = length(description) )
@@ -230,3 +230,45 @@ description:keyword | height_range:unsupported | x:integer | _fork:keyword
230230
Very Tall | null | 9 | fork1
231231
Medium Height | null | null | fork2
232232
;
233+
234+
forkAfterLookupJoin
235+
required_capability: fork_v6
236+
237+
FROM employees
238+
| EVAL language_code = languages
239+
| LOOKUP JOIN languages_lookup ON language_code
240+
| FORK (WHERE emp_no == 10048 OR emp_no == 10081)
241+
(WHERE emp_no == 10081 OR emp_no == 10087)
242+
(WHERE emp_no == 10081 | EVAL language_name = "Klingon")
243+
| KEEP _fork, emp_no, language_code, language_name
244+
| SORT _fork, emp_no
245+
;
246+
247+
_fork:keyword | emp_no:integer | language_code:integer | language_name:keyword
248+
fork1 | 10048 | 3 | Spanish
249+
fork1 | 10081 | 2 | French
250+
fork2 | 10081 | 2 | French
251+
fork2 | 10087 | 5 | null
252+
fork3 | 10081 | 2 | Klingon
253+
;
254+
255+
forkBeforeLookupJoin
256+
required_capability: fork_v6
257+
258+
FROM employees
259+
| EVAL language_code = languages
260+
| FORK (WHERE emp_no == 10048 OR emp_no == 10081)
261+
(WHERE emp_no == 10081 OR emp_no == 10087)
262+
(WHERE emp_no == 10081 | EVAL language_name = "Klingon")
263+
| LOOKUP JOIN languages_lookup ON language_code
264+
| KEEP _fork, emp_no, language_code, language_name
265+
| SORT _fork, emp_no
266+
;
267+
268+
_fork:keyword | emp_no:integer | language_code:integer | language_name:keyword
269+
fork1 | 10048 | 3 | Spanish
270+
fork1 | 10081 | 2 | French
271+
fork2 | 10081 | 2 | French
272+
fork2 | 10087 | 5 | null
273+
fork3 | 10081 | 2 | French
274+
;

0 commit comments

Comments
 (0)