Skip to content

Commit d102b0f

Browse files
authored
Merge branch 'main' into retry_elasticsearch_inference_service
2 parents 90f1bfb + afc53a3 commit d102b0f

File tree

100 files changed

+5482
-1110
lines changed

Some content is hidden

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

100 files changed

+5482
-1110
lines changed

docs/changelog/127582.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 127582
2+
summary: Specialize ags `AddInput` for each block type
3+
area: ES|QL
4+
type: enhancement
5+
issues: []

docs/reference/elasticsearch/configuration-reference/security-settings.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,6 +1486,15 @@ $$$jwt-claim-pattern-principal$$$
14861486
`client_authentication.rotation_grace_period`
14871487
: ([Static](docs-content://deploy-manage/deploy/self-managed/configure-elasticsearch.md#static-cluster-setting)) Sets the grace period for how long after rotating the `client_authentication.shared_secret` is valid. `client_authentication.shared_secret` can be rotated by updating the keystore then calling the [reload API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-reload-secure-settings). Defaults to `1m`.
14881488

1489+
`http.proxy.host`
1490+
: ([Static](docs-content://deploy-manage/deploy/self-managed/configure-elasticsearch.md#static-cluster-setting)) Specifies the address of the proxy server for the HTTP client that is used for fetching the JSON Web Key Set from a remote URL.
1491+
1492+
`http.proxy.scheme`
1493+
: ([Static](docs-content://deploy-manage/deploy/self-managed/configure-elasticsearch.md#static-cluster-setting)) Specifies the protocol to use to connect to the proxy server for the HTTP client that is used for fetching the JSON Web Key Set from a remote URL. Must be `http`.
1494+
1495+
`http.proxy.port`
1496+
: ([Static](docs-content://deploy-manage/deploy/self-managed/configure-elasticsearch.md#static-cluster-setting)) Specifies the port of the proxy server for the HTTP client that is used for fetching the JSON Web Key Set from a remote URL. Defaults to `80`.
1497+
14891498
`http.connect_timeout` ![logo cloud](https://doc-icons.s3.us-east-2.amazonaws.com/logo_cloud.svg "Supported on Elastic Cloud Hosted")
14901499
: ([Static](docs-content://deploy-manage/deploy/self-managed/configure-elasticsearch.md#static-cluster-setting)) Sets the timeout for the HTTP client that is used for fetching the JSON Web Key Set from a remote URL. A value of zero means the timeout is not used. Defaults to `5s`.
14911500

server/src/main/java/org/elasticsearch/indices/IndicesService.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,19 +1064,25 @@ public void afterIndexShardClosed(ShardId shardId, IndexShard indexShard, Settin
10641064
/**
10651065
* Deletes an index that is not assigned to this node. This method cleans up all disk folders relating to the index
10661066
* but does not deal with in-memory structures. For those call {@link #removeIndex}
1067+
*
1068+
* @param reason the reason why this index should be deleted
1069+
* @param oldIndexMetadata the index metadata of the index that should be deleted
1070+
* @param currentProject the <i>current</i> project metadata which is used to verify that the index does not exist in the project
1071+
* anymore - can be null in case the whole project got deleted while there were still indices in it
10671072
*/
10681073
@Override
1069-
public void deleteUnassignedIndex(String reason, IndexMetadata oldIndexMetadata, ClusterState clusterState) {
1074+
public void deleteUnassignedIndex(String reason, IndexMetadata oldIndexMetadata, @Nullable ProjectMetadata currentProject) {
10701075
if (nodeEnv.hasNodeFile()) {
10711076
Index index = oldIndexMetadata.getIndex();
10721077
try {
1073-
if (clusterState.metadata().getProject().hasIndex(index)) {
1074-
final IndexMetadata currentMetadata = clusterState.metadata().getProject().index(index);
1078+
if (currentProject != null && currentProject.hasIndex(index)) {
1079+
final IndexMetadata currentMetadata = currentProject.index(index);
10751080
throw new IllegalStateException(
10761081
"Can't delete unassigned index store for ["
10771082
+ index.getName()
1078-
+ "] - it's still part "
1079-
+ "of the cluster state ["
1083+
+ "] - it's still part of project ["
1084+
+ currentProject.id()
1085+
+ "] with UUIDs ["
10801086
+ currentMetadata.getIndexUUID()
10811087
+ "] ["
10821088
+ oldIndexMetadata.getIndexUUID()

server/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,12 @@ private void deleteIndices(final ClusterChangedEvent event) {
400400
indexServiceClosedListener = SubscribableListener.nullSuccess();
401401
final IndexMetadata metadata = project.get().index(index);
402402
indexSettings = new IndexSettings(metadata, settings);
403-
indicesService.deleteUnassignedIndex("deleted index was not assigned to local node", metadata, state);
403+
final var projectId = project.get().id();
404+
indicesService.deleteUnassignedIndex(
405+
"deleted index in project [" + projectId + "] was not assigned to local node",
406+
metadata,
407+
state.metadata().projects().get(projectId)
408+
);
404409
} else {
405410
// The previous cluster state's metadata also does not contain the index,
406411
// which is what happens on node startup when an index was deleted while the
@@ -1257,8 +1262,13 @@ U createIndex(IndexMetadata indexMetadata, List<IndexEventListener> builtInIndex
12571262
/**
12581263
* Deletes an index that is not assigned to this node. This method cleans up all disk folders relating to the index
12591264
* but does not deal with in-memory structures. For those call {@link #removeIndex}
1265+
*
1266+
* @param reason the reason why this index should be deleted
1267+
* @param oldIndexMetadata the index metadata of the index that should be deleted
1268+
* @param currentProject the <i>current</i> project metadata which is used to verify that the index does not exist in the project
1269+
* anymore - can be null in case the whole project got deleted while there were still indices in it
12601270
*/
1261-
void deleteUnassignedIndex(String reason, IndexMetadata metadata, ClusterState clusterState);
1271+
void deleteUnassignedIndex(String reason, IndexMetadata oldIndexMetadata, @Nullable ProjectMetadata currentProject);
12621272

12631273
/**
12641274
* Removes the given index from this service and releases all associated resources. Persistent parts of the index

test/framework/src/main/java/org/elasticsearch/indices/cluster/AbstractIndicesClusterStateServiceTestCase.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.elasticsearch.action.ActionListener;
1313
import org.elasticsearch.cluster.ClusterState;
1414
import org.elasticsearch.cluster.metadata.IndexMetadata;
15+
import org.elasticsearch.cluster.metadata.ProjectMetadata;
1516
import org.elasticsearch.cluster.node.DiscoveryNode;
1617
import org.elasticsearch.cluster.routing.IndexShardRoutingTable;
1718
import org.elasticsearch.cluster.routing.RoutingNode;
@@ -213,7 +214,7 @@ public IndexMetadata verifyIndexIsDeleted(Index index, ClusterState state) {
213214
}
214215

215216
@Override
216-
public void deleteUnassignedIndex(String reason, IndexMetadata metadata, ClusterState clusterState) {
217+
public void deleteUnassignedIndex(String reason, IndexMetadata oldIndexMetadata, ProjectMetadata currentProject) {
217218

218219
}
219220

x-pack/plugin/esql/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ dependencies {
5353
testImplementation project(path: xpackModule('enrich'))
5454
testImplementation project(path: xpackModule('spatial'))
5555
testImplementation project(path: xpackModule('kql'))
56+
testImplementation project(path: xpackModule('mapper-unsigned-long'))
5657

5758
testImplementation project(path: ':modules:reindex')
5859
testImplementation project(path: ':modules:parent-join')

x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/GroupingAggregatorImplementer.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@
5454
import static org.elasticsearch.compute.gen.Types.GROUPING_AGGREGATOR_FUNCTION;
5555
import static org.elasticsearch.compute.gen.Types.GROUPING_AGGREGATOR_FUNCTION_ADD_INPUT;
5656
import static org.elasticsearch.compute.gen.Types.INTERMEDIATE_STATE_DESC;
57-
import static org.elasticsearch.compute.gen.Types.INT_BLOCK;
57+
import static org.elasticsearch.compute.gen.Types.INT_ARRAY_BLOCK;
58+
import static org.elasticsearch.compute.gen.Types.INT_BIG_ARRAY_BLOCK;
5859
import static org.elasticsearch.compute.gen.Types.INT_VECTOR;
5960
import static org.elasticsearch.compute.gen.Types.LIST_AGG_FUNC_DESC;
6061
import static org.elasticsearch.compute.gen.Types.LIST_INTEGER;
@@ -76,6 +77,8 @@
7677
* and break-point-able as possible.
7778
*/
7879
public class GroupingAggregatorImplementer {
80+
private static final List<ClassName> GROUP_IDS_CLASSES = List.of(INT_ARRAY_BLOCK, INT_BIG_ARRAY_BLOCK, INT_VECTOR);
81+
7982
private final TypeElement declarationType;
8083
private final List<TypeMirror> warnExceptions;
8184
private final ExecutableElement init;
@@ -196,10 +199,10 @@ private TypeSpec type() {
196199
builder.addMethod(intermediateStateDesc());
197200
builder.addMethod(intermediateBlockCount());
198201
builder.addMethod(prepareProcessPage());
199-
builder.addMethod(addRawInputLoop(INT_VECTOR, blockType(aggParam.type())));
200-
builder.addMethod(addRawInputLoop(INT_VECTOR, vectorType(aggParam.type())));
201-
builder.addMethod(addRawInputLoop(INT_BLOCK, blockType(aggParam.type())));
202-
builder.addMethod(addRawInputLoop(INT_BLOCK, vectorType(aggParam.type())));
202+
for (ClassName groupIdClass : GROUP_IDS_CLASSES) {
203+
builder.addMethod(addRawInputLoop(groupIdClass, blockType(aggParam.type())));
204+
builder.addMethod(addRawInputLoop(groupIdClass, vectorType(aggParam.type())));
205+
}
203206
builder.addMethod(selectedMayContainUnseenGroups());
204207
builder.addMethod(addIntermediateInput());
205208
builder.addMethod(addIntermediateRowInput());
@@ -347,15 +350,12 @@ private TypeSpec addInput(Consumer<MethodSpec.Builder> addBlock) {
347350
TypeSpec.Builder builder = TypeSpec.anonymousClassBuilder("");
348351
builder.addSuperinterface(GROUPING_AGGREGATOR_FUNCTION_ADD_INPUT);
349352

350-
MethodSpec.Builder block = MethodSpec.methodBuilder("add").addAnnotation(Override.class).addModifiers(Modifier.PUBLIC);
351-
block.addParameter(TypeName.INT, "positionOffset").addParameter(INT_BLOCK, "groupIds");
352-
addBlock.accept(block);
353-
builder.addMethod(block.build());
354-
355-
MethodSpec.Builder vector = MethodSpec.methodBuilder("add").addAnnotation(Override.class).addModifiers(Modifier.PUBLIC);
356-
vector.addParameter(TypeName.INT, "positionOffset").addParameter(INT_VECTOR, "groupIds");
357-
addBlock.accept(vector);
358-
builder.addMethod(vector.build());
353+
for (ClassName groupIdsType : GROUP_IDS_CLASSES) {
354+
MethodSpec.Builder vector = MethodSpec.methodBuilder("add").addAnnotation(Override.class).addModifiers(Modifier.PUBLIC);
355+
vector.addParameter(TypeName.INT, "positionOffset").addParameter(groupIdsType, "groupIds");
356+
addBlock.accept(vector);
357+
builder.addMethod(vector.build());
358+
}
359359

360360
MethodSpec.Builder close = MethodSpec.methodBuilder("close").addAnnotation(Override.class).addModifiers(Modifier.PUBLIC);
361361
builder.addMethod(close.build());

x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/Types.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ public class Types {
4646
static final ClassName BOOLEAN_BLOCK = ClassName.get(DATA_PACKAGE, "BooleanBlock");
4747
static final ClassName BYTES_REF_BLOCK = ClassName.get(DATA_PACKAGE, "BytesRefBlock");
4848
static final ClassName INT_BLOCK = ClassName.get(DATA_PACKAGE, "IntBlock");
49+
static final ClassName INT_ARRAY_BLOCK = ClassName.get(DATA_PACKAGE, "IntArrayBlock");
50+
static final ClassName INT_BIG_ARRAY_BLOCK = ClassName.get(DATA_PACKAGE, "IntBigArrayBlock");
4951
static final ClassName LONG_BLOCK = ClassName.get(DATA_PACKAGE, "LongBlock");
5052
static final ClassName DOUBLE_BLOCK = ClassName.get(DATA_PACKAGE, "DoubleBlock");
5153
static final ClassName FLOAT_BLOCK = ClassName.get(DATA_PACKAGE, "FloatBlock");

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/BooleanArrayBlock.java

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/BytesRefArrayBlock.java

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)