Skip to content

Commit 398cd04

Browse files
committed
Merge remote-tracking branch 'upstream/main' into float-byte-script-comparisons
2 parents 40dcd8f + a895875 commit 398cd04

File tree

47 files changed

+454
-959
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+454
-959
lines changed

docs/changelog/122938.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 122938
2+
summary: Fix geoip databases index access after system feature migration (again)
3+
area: Ingest Node
4+
type: bug
5+
issues: []

docs/changelog/123010.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 123010
2+
summary: Hold store reference in `InternalEngine#performActionWithDirectoryReader(...)`
3+
area: Engine
4+
type: bug
5+
issues:
6+
- 122974

modules/ingest-geoip/qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/ingest/geoip/FullClusterRestartIT.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,19 @@ public void testGeoIpSystemFeaturesMigration() throws Exception {
123123

124124
// as should a normal get *
125125
assertBusy(() -> testGetStar(List.of("my-index-00001"), maybeSecurityIndex));
126+
127+
// and getting data streams
128+
assertBusy(() -> testGetDatastreams());
126129
} else {
127130
// after the upgrade, but before the migration, Kibana should work
128131
assertBusy(() -> testGetStarAsKibana(List.of("my-index-00001"), maybeSecurityIndex));
129132

130133
// as should a normal get *
131134
assertBusy(() -> testGetStar(List.of("my-index-00001"), maybeSecurityIndex));
132135

136+
// and getting data streams
137+
assertBusy(() -> testGetDatastreams());
138+
133139
// migrate the system features and give the cluster a moment to settle
134140
Request migrateSystemFeatures = new Request("POST", "/_migration/system_features");
135141
assertOK(client().performRequest(migrateSystemFeatures));
@@ -144,6 +150,9 @@ public void testGeoIpSystemFeaturesMigration() throws Exception {
144150
// as should a normal get *
145151
assertBusy(() -> testGetStar(List.of("my-index-00001"), maybeSecurityIndexReindexed));
146152

153+
// and getting data streams
154+
assertBusy(() -> testGetDatastreams());
155+
147156
Request disableDownloader = new Request("PUT", "/_cluster/settings");
148157
disableDownloader.setJsonEntity("""
149158
{"persistent": {"ingest.geoip.downloader.enabled": false}}
@@ -257,4 +266,15 @@ private void testGetStarAsKibana(List<String> indexNames, @Nullable List<String>
257266
Map<String, Object> map = responseAsMap(response);
258267
assertThat(map.keySet(), is(new HashSet<>(indexNames)));
259268
}
269+
270+
private void testGetDatastreams() throws IOException {
271+
Request getStar = new Request("GET", "_data_stream");
272+
getStar.setOptions(
273+
RequestOptions.DEFAULT.toBuilder().setWarningsHandler(WarningsHandler.PERMISSIVE) // we don't care about warnings, just errors
274+
);
275+
Response response = client().performRequest(getStar);
276+
assertOK(response);
277+
278+
// note: we don't actually care about the response, just that there was one and that it didn't error out on us
279+
}
260280
}

modules/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/DatabaseNodeServiceTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import org.elasticsearch.persistent.PersistentTasksCustomMetadata;
5151
import org.elasticsearch.search.SearchHit;
5252
import org.elasticsearch.search.SearchHits;
53+
import org.elasticsearch.search.SearchResponseUtils;
5354
import org.elasticsearch.test.ESTestCase;
5455
import org.elasticsearch.threadpool.TestThreadPool;
5556
import org.elasticsearch.threadpool.ThreadPool;
@@ -341,7 +342,7 @@ private String mockSearches(String databaseName, int firstChunk, int lastChunk)
341342
}
342343

343344
SearchHits hits = SearchHits.unpooled(new SearchHit[] { hit }, new TotalHits(1, TotalHits.Relation.EQUAL_TO), 1f);
344-
SearchResponse searchResponse = new SearchResponse(hits, null, null, false, null, null, 0, null, 1, 1, 0, 1L, null, null);
345+
SearchResponse searchResponse = SearchResponseUtils.successfulResponse(hits);
345346
toRelease.add(searchResponse::decRef);
346347
@SuppressWarnings("unchecked")
347348
ActionFuture<SearchResponse> actionFuture = mock(ActionFuture.class);

modules/reindex/src/test/java/org/elasticsearch/reindex/AsyncBulkByScrollActionTests.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
import org.elasticsearch.rest.RestStatus;
6969
import org.elasticsearch.search.SearchHit;
7070
import org.elasticsearch.search.SearchHits;
71+
import org.elasticsearch.search.SearchResponseUtils;
7172
import org.elasticsearch.tasks.Task;
7273
import org.elasticsearch.tasks.TaskId;
7374
import org.elasticsearch.tasks.TaskManager;
@@ -574,22 +575,7 @@ protected RequestWrapper<?> buildRequest(Hit doc) {
574575
new TotalHits(0, TotalHits.Relation.EQUAL_TO),
575576
0
576577
);
577-
SearchResponse searchResponse = new SearchResponse(
578-
hits,
579-
null,
580-
null,
581-
false,
582-
false,
583-
null,
584-
1,
585-
scrollId(),
586-
5,
587-
4,
588-
0,
589-
randomLong(),
590-
null,
591-
SearchResponse.Clusters.EMPTY
592-
);
578+
SearchResponse searchResponse = SearchResponseUtils.response(hits).scrollId(scrollId()).shards(5, 4, 0).build();
593579
try {
594580
client.lastSearch.get().listener.onResponse(searchResponse);
595581

modules/reindex/src/test/java/org/elasticsearch/reindex/ClientScrollableHitSourceTests.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import org.elasticsearch.index.reindex.ScrollableHitSource;
3131
import org.elasticsearch.search.SearchHit;
3232
import org.elasticsearch.search.SearchHits;
33+
import org.elasticsearch.search.SearchResponseUtils;
3334
import org.elasticsearch.tasks.TaskId;
3435
import org.elasticsearch.test.ESTestCase;
3536
import org.elasticsearch.threadpool.TestThreadPool;
@@ -166,22 +167,7 @@ private SearchResponse createSearchResponse() {
166167
new TotalHits(0, TotalHits.Relation.EQUAL_TO),
167168
0
168169
);
169-
return new SearchResponse(
170-
hits,
171-
null,
172-
null,
173-
false,
174-
false,
175-
null,
176-
1,
177-
randomSimpleString(random(), 1, 10),
178-
5,
179-
4,
180-
0,
181-
randomLong(),
182-
null,
183-
SearchResponse.Clusters.EMPTY
184-
);
170+
return SearchResponseUtils.response(hits).scrollId(randomSimpleString(random(), 1, 10)).shards(5, 4, 0).build();
185171
}
186172

187173
private void assertSameHits(List<? extends ScrollableHitSource.Hit> actual, SearchHit[] expected) {

muted-tests.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,6 @@ tests:
314314
issue: https://github.com/elastic/elasticsearch/issues/122913
315315
- class: org.elasticsearch.xpack.search.AsyncSearchSecurityIT
316316
issue: https://github.com/elastic/elasticsearch/issues/122940
317-
- class: org.elasticsearch.action.admin.indices.create.ShrinkIndexIT
318-
method: testShrinkIndexPrimaryTerm
319-
issue: https://github.com/elastic/elasticsearch/issues/122974
320317
- class: org.elasticsearch.test.apmintegration.TracesApmIT
321318
method: testApmIntegration
322319
issue: https://github.com/elastic/elasticsearch/issues/122129
@@ -389,6 +386,15 @@ tests:
389386
- class: org.elasticsearch.xpack.esql.qa.mixed.EsqlClientYamlIT
390387
method: test {p0=esql/40_tsdb/render aggregate_metric_double when missing min and max}
391388
issue: https://github.com/elastic/elasticsearch/issues/123124
389+
- class: org.elasticsearch.index.mapper.extras.ScaledFloatFieldMapperTests
390+
method: testBlockLoaderFromRowStrideReader
391+
issue: https://github.com/elastic/elasticsearch/issues/123126
392+
- class: org.elasticsearch.xpack.esql.qa.mixed.EsqlClientYamlIT
393+
method: test {p0=esql/40_tsdb/render aggregate_metric_double when missing value}
394+
issue: https://github.com/elastic/elasticsearch/issues/123130
395+
- class: org.elasticsearch.xpack.esql.ccq.MultiClusterSpecIT
396+
method: test {fork.ForkWithWhereSortAndLimit}
397+
issue: https://github.com/elastic/elasticsearch/issues/123131
392398

393399
# Examples:
394400
#

qa/ccs-unavailable-clusters/src/javaRestTest/java/org/elasticsearch/search/CrossClusterSearchUnavailableClusterIT.java

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,13 @@
1212
import org.apache.http.HttpEntity;
1313
import org.apache.http.entity.ContentType;
1414
import org.apache.http.nio.entity.NStringEntity;
15-
import org.apache.lucene.search.TotalHits;
1615
import org.elasticsearch.TransportVersion;
1716
import org.elasticsearch.action.admin.cluster.state.ClusterStateAction;
1817
import org.elasticsearch.action.admin.cluster.state.ClusterStateRequest;
1918
import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse;
2019
import org.elasticsearch.action.search.SearchRequest;
21-
import org.elasticsearch.action.search.SearchResponse;
2220
import org.elasticsearch.action.search.SearchShardsRequest;
2321
import org.elasticsearch.action.search.SearchShardsResponse;
24-
import org.elasticsearch.action.search.ShardSearchFailure;
2522
import org.elasticsearch.action.search.TransportSearchAction;
2623
import org.elasticsearch.action.search.TransportSearchShardsAction;
2724
import org.elasticsearch.client.Request;
@@ -33,11 +30,11 @@
3330
import org.elasticsearch.cluster.node.DiscoveryNodes;
3431
import org.elasticsearch.cluster.node.VersionInformation;
3532
import org.elasticsearch.common.Strings;
33+
import org.elasticsearch.common.lucene.Lucene;
3634
import org.elasticsearch.common.settings.SecureString;
3735
import org.elasticsearch.common.settings.Settings;
3836
import org.elasticsearch.common.util.concurrent.EsExecutors;
3937
import org.elasticsearch.common.util.concurrent.ThreadContext;
40-
import org.elasticsearch.search.aggregations.InternalAggregations;
4138
import org.elasticsearch.test.cluster.ElasticsearchCluster;
4239
import org.elasticsearch.test.rest.ESRestTestCase;
4340
import org.elasticsearch.test.rest.ObjectPath;
@@ -102,21 +99,8 @@ private static MockTransportService startTransport(
10299
EsExecutors.DIRECT_EXECUTOR_SERVICE,
103100
SearchRequest::new,
104101
(request, channel, task) -> {
105-
var searchResponse = new SearchResponse(
106-
SearchHits.empty(new TotalHits(0, TotalHits.Relation.EQUAL_TO), Float.NaN),
107-
InternalAggregations.EMPTY,
108-
null,
109-
false,
110-
null,
111-
null,
112-
1,
113-
null,
114-
1,
115-
1,
116-
0,
117-
100,
118-
ShardSearchFailure.EMPTY_ARRAY,
119-
SearchResponse.Clusters.EMPTY
102+
var searchResponse = SearchResponseUtils.successfulResponse(
103+
SearchHits.empty(Lucene.TOTAL_HITS_EQUAL_TO_ZERO, Float.NaN)
120104
);
121105
try {
122106
channel.sendResponse(searchResponse);

rest-api-spec/src/main/resources/rest-api-spec/api/cat.help.json

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,6 @@
1818
]
1919
}
2020
]
21-
},
22-
"params":{
23-
"help":{
24-
"type":"boolean",
25-
"description":"Return help information",
26-
"default":false
27-
},
28-
"s":{
29-
"type":"list",
30-
"description":"Comma-separated list of column names or column aliases to sort by"
31-
}
3221
}
3322
}
3423
}

rest-api-spec/src/main/resources/rest-api-spec/api/cat.segments.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@
3636
"type":"string",
3737
"description":"a short version of the Accept header, e.g. json, yaml"
3838
},
39+
"local":{
40+
"type":"boolean",
41+
"description":"Return local information, do not retrieve the state from master node (default: false)"
42+
},
43+
"master_timeout":{
44+
"type":"time",
45+
"description":"Explicit operation timeout for connection to master node"
46+
},
3947
"bytes":{
4048
"type":"enum",
4149
"description":"The unit in which to display byte values",

0 commit comments

Comments
 (0)