Skip to content

Commit 118c27f

Browse files
Merge branch 'main' into semantic-text_oom-circuit-breaker
2 parents f4aef73 + ecf9adf commit 118c27f

File tree

72 files changed

+2097
-445
lines changed

Some content is hidden

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

72 files changed

+2097
-445
lines changed

docs/changelog/126409.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 126409
2+
summary: System data streams are not being upgraded in the feature migration API
3+
area: Infra/Core
4+
type: bug
5+
issues:
6+
- 122949

docs/changelog/126411.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 126411
2+
summary: Fix usage of already released null block in `ValueSourceReaderOperator`
3+
area: ES|QL
4+
type: bug
5+
issues:
6+
- 125850

docs/changelog/126452.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 126452
2+
summary: Run `newShardSnapshotTask` tasks concurrently
3+
area: Snapshot/Restore
4+
type: bug
5+
issues: []

modules/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/SystemDataStreamIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ public Collection<SystemDataStreamDescriptor> getSystemDataStreamDescriptors() {
326326
.build(),
327327
Map.of(),
328328
List.of("product"),
329+
"product",
329330
ExecutorNames.DEFAULT_SYSTEM_DATA_STREAM_THREAD_POOLS
330331
)
331332
);

modules/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/SystemDataStreamSnapshotIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ public Collection<SystemDataStreamDescriptor> getSystemDataStreamDescriptors() {
275275
.build(),
276276
Map.of(),
277277
Collections.singletonList("test"),
278+
"test",
278279
new ExecutorNames(ThreadPool.Names.SYSTEM_CRITICAL_READ, ThreadPool.Names.SYSTEM_READ, ThreadPool.Names.SYSTEM_WRITE)
279280
)
280281
);

modules/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/lifecycle/CrudSystemDataStreamLifecycleIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ public Collection<SystemDataStreamDescriptor> getSystemDataStreamDescriptors() {
213213
.build(),
214214
Map.of(),
215215
List.of("product"),
216+
"product",
216217
ExecutorNames.DEFAULT_SYSTEM_DATA_STREAM_THREAD_POOLS
217218
)
218219
);

modules/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/lifecycle/DataStreamLifecycleServiceIT.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,6 +1094,7 @@ public Collection<SystemDataStreamDescriptor> getSystemDataStreamDescriptors() {
10941094
.build(),
10951095
Map.of(),
10961096
List.of(),
1097+
"test",
10971098
ExecutorNames.DEFAULT_SYSTEM_INDEX_THREAD_POOLS
10981099
)
10991100
);

modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/RemoveProcessorTests.java

Lines changed: 17 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
import org.elasticsearch.script.TemplateScript;
1717
import org.elasticsearch.test.ESTestCase;
1818

19-
import java.util.ArrayList;
19+
import java.util.Arrays;
2020
import java.util.HashMap;
2121
import java.util.List;
2222
import java.util.Map;
2323

24+
import static org.elasticsearch.ingest.common.RemoveProcessor.shouldKeep;
2425
import static org.hamcrest.Matchers.containsString;
2526
import static org.hamcrest.Matchers.is;
2627

@@ -124,13 +125,9 @@ public void testKeepFields() throws Exception {
124125

125126
IngestDocument document = RandomDocumentPicks.randomIngestDocument(random(), source);
126127

127-
List<TemplateScript.Factory> fieldsToKeep = List.of(
128-
new TestTemplateService.MockTemplateScript.Factory("name"),
129-
new TestTemplateService.MockTemplateScript.Factory("address.street")
130-
);
131-
132-
Processor processor = new RemoveProcessor(randomAlphaOfLength(10), null, new ArrayList<>(), fieldsToKeep, false);
128+
Processor processor = new RemoveProcessor(null, null, List.of(), templates("name", "address.street"), false);
133129
processor.execute(document);
130+
134131
assertTrue(document.hasField("name"));
135132
assertTrue(document.hasField("address"));
136133
assertTrue(document.hasField("address.street"));
@@ -142,7 +139,7 @@ public void testKeepFields() throws Exception {
142139
assertTrue(document.hasField("_version_type"));
143140
}
144141

145-
public void testShouldKeep(String a, String b) {
142+
public void testShouldKeep() {
146143
Map<String, Object> address = new HashMap<>();
147144
address.put("street", "Ipiranga Street");
148145
address.put("number", 123);
@@ -153,37 +150,18 @@ public void testShouldKeep(String a, String b) {
153150

154151
IngestDocument document = RandomDocumentPicks.randomIngestDocument(random(), source);
155152

156-
assertTrue(RemoveProcessor.shouldKeep("name", List.of(new TestTemplateService.MockTemplateScript.Factory("name")), document));
157-
158-
assertTrue(RemoveProcessor.shouldKeep("age", List.of(new TestTemplateService.MockTemplateScript.Factory("age")), document));
159-
160-
assertFalse(RemoveProcessor.shouldKeep("name", List.of(new TestTemplateService.MockTemplateScript.Factory("age")), document));
161-
162-
assertTrue(
163-
RemoveProcessor.shouldKeep("address", List.of(new TestTemplateService.MockTemplateScript.Factory("address.street")), document)
164-
);
165-
166-
assertTrue(
167-
RemoveProcessor.shouldKeep("address", List.of(new TestTemplateService.MockTemplateScript.Factory("address.number")), document)
168-
);
169-
170-
assertTrue(
171-
RemoveProcessor.shouldKeep("address.street", List.of(new TestTemplateService.MockTemplateScript.Factory("address")), document)
172-
);
173-
174-
assertTrue(
175-
RemoveProcessor.shouldKeep("address.number", List.of(new TestTemplateService.MockTemplateScript.Factory("address")), document)
176-
);
177-
178-
assertTrue(RemoveProcessor.shouldKeep("address", List.of(new TestTemplateService.MockTemplateScript.Factory("address")), document));
179-
180-
assertFalse(
181-
RemoveProcessor.shouldKeep(
182-
"address.street",
183-
List.of(new TestTemplateService.MockTemplateScript.Factory("address.number")),
184-
document
185-
)
186-
);
153+
assertTrue(shouldKeep("name", templates("name"), document));
154+
assertTrue(shouldKeep("age", templates("age"), document));
155+
assertFalse(shouldKeep("name", templates("age"), document));
156+
assertTrue(shouldKeep("address", templates("address.street"), document));
157+
assertTrue(shouldKeep("address", templates("address.number"), document));
158+
assertTrue(shouldKeep("address.street", templates("address"), document));
159+
assertTrue(shouldKeep("address.number", templates("address"), document));
160+
assertTrue(shouldKeep("address", templates("address"), document));
161+
assertFalse(shouldKeep("address.street", templates("address.number"), document));
187162
}
188163

164+
private static List<TemplateScript.Factory> templates(String... fields) {
165+
return Arrays.stream(fields).map(f -> (TemplateScript.Factory) new TestTemplateService.MockTemplateScript.Factory(f)).toList();
166+
}
189167
}

modules/repository-gcs/src/test/java/org/elasticsearch/repositories/gcs/GoogleCloudStorageBlobContainerRetriesTests.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public void testShouldRetryOnUnresolvableHost() {
229229

230230
private void executeListBlobsAndAssertRetries() {
231231
final int maxRetries = randomIntBetween(3, 5);
232-
final BlobContainer blobContainer = createBlobContainer(maxRetries, null, null, null, null, null, null);
232+
final BlobContainer blobContainer = blobContainerBuilder().maxRetries(maxRetries).build();
233233
expectThrows(StorageException.class, () -> blobContainer.listBlobs(randomPurpose()));
234234
assertEquals(maxRetries + 1, requestCounters.get("/storage/v1/b/bucket/o").get());
235235
}
@@ -238,7 +238,7 @@ public void testReadLargeBlobWithRetries() throws Exception {
238238
final int maxRetries = randomIntBetween(2, 10);
239239
final AtomicInteger countDown = new AtomicInteger(maxRetries);
240240

241-
final BlobContainer blobContainer = createBlobContainer(maxRetries, null, null, null, null, null, null);
241+
final BlobContainer blobContainer = blobContainerBuilder().maxRetries(maxRetries).build();
242242

243243
// SDK reads in 2 MB chunks so we use twice that to simulate 2 chunks
244244
final byte[] bytes = randomBytes(1 << 22);
@@ -267,7 +267,7 @@ public void testWriteBlobWithRetries() throws Exception {
267267
final int maxRetries = randomIntBetween(2, 10);
268268
final CountDown countDown = new CountDown(maxRetries);
269269

270-
final BlobContainer blobContainer = createBlobContainer(maxRetries, null, null, null, null, null, null);
270+
final BlobContainer blobContainer = blobContainerBuilder().maxRetries(maxRetries).build();
271271
final byte[] bytes = randomBlobContent();
272272
httpServer.createContext("/upload/storage/v1/b/bucket/o", safeHandler(exchange -> {
273273
assertThat(exchange.getRequestURI().getQuery(), containsString("uploadType=multipart"));
@@ -309,7 +309,7 @@ public void testWriteBlobWithRetries() throws Exception {
309309
public void testWriteBlobWithReadTimeouts() {
310310
final byte[] bytes = randomByteArrayOfLength(randomIntBetween(10, 128));
311311
final TimeValue readTimeout = TimeValue.timeValueMillis(randomIntBetween(100, 500));
312-
final BlobContainer blobContainer = createBlobContainer(1, readTimeout, null, null, null, null, null);
312+
final BlobContainer blobContainer = blobContainerBuilder().maxRetries(1).readTimeout(readTimeout).build();
313313

314314
// HTTP server does not send a response
315315
httpServer.createContext("/upload/storage/v1/b/bucket/o", exchange -> {
@@ -361,7 +361,7 @@ public void testWriteLargeBlob() throws IOException {
361361
logger.debug("starting with resumable upload id [{}]", sessionUploadId.get());
362362

363363
final TimeValue readTimeout = allowReadTimeout.get() ? TimeValue.timeValueSeconds(3) : null;
364-
final BlobContainer blobContainer = createBlobContainer(nbErrors + 1, readTimeout, null, null, null, null, null);
364+
final BlobContainer blobContainer = blobContainerBuilder().maxRetries(nbErrors + 1).readTimeout(readTimeout).build();
365365

366366
httpServer.createContext("/upload/storage/v1/b/bucket/o", safeHandler(exchange -> {
367367
final BytesReference requestBody = Streams.readFully(exchange.getRequestBody());
@@ -508,7 +508,7 @@ public String next() {
508508
return Integer.toString(totalDeletesSent++);
509509
}
510510
};
511-
final BlobContainer blobContainer = createBlobContainer(1, null, null, null, null, null, null);
511+
final BlobContainer blobContainer = blobContainerBuilder().maxRetries(1).build();
512512
httpServer.createContext("/batch/storage/v1", safeHandler(exchange -> {
513513
assert pendingDeletes.get() <= MAX_DELETES_PER_BATCH;
514514

@@ -544,7 +544,7 @@ public void testCompareAndExchangeWhenThrottled() throws IOException {
544544
httpServer.createContext("/", new ResponseInjectingHttpHandler(requestHandlers, new GoogleCloudStorageHttpHandler("bucket")));
545545

546546
final int maxRetries = randomIntBetween(1, 3);
547-
final BlobContainer container = createBlobContainer(maxRetries, null, null, null, null, null, null);
547+
final BlobContainer container = blobContainerBuilder().maxRetries(maxRetries).build();
548548
final byte[] data = randomBytes(randomIntBetween(1, BlobContainerUtils.MAX_REGISTER_CONTENT_LENGTH));
549549
final String key = randomIdentifier();
550550

0 commit comments

Comments
 (0)