Skip to content

Commit e6b1e5d

Browse files
committed
Merge branch 'main' into esql-join-multivalue-on-index-warnings
# Conflicts: # server/src/main/java/org/elasticsearch/TransportVersions.java
2 parents e627316 + 7f284d3 commit e6b1e5d

File tree

173 files changed

+4854
-3213
lines changed

Some content is hidden

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

173 files changed

+4854
-3213
lines changed

.buildkite/pipelines/periodic.template.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ steps:
8686
ES_RUNTIME_JAVA:
8787
- openjdk21
8888
- openjdk23
89+
- openjdk24
8990
GRADLE_TASK:
9091
- checkPart1
9192
- checkPart2

.buildkite/pipelines/periodic.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ steps:
505505
ES_RUNTIME_JAVA:
506506
- openjdk21
507507
- openjdk23
508+
- openjdk24
508509
GRADLE_TASK:
509510
- checkPart1
510511
- checkPart2

docs/changelog/120751.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 120751
2+
summary: Adding support for binary embedding type to Cohere service embedding type
3+
area: Machine Learning
4+
type: enhancement
5+
issues: []

docs/changelog/120807.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/changelog/120957.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 120957
2+
summary: Introduce `AllocationBalancingRoundSummaryService`
3+
area: Allocation
4+
type: enhancement
5+
issues: []

docs/changelog/121240.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 121240
2+
summary: Implement runtime skip_unavailable=true
3+
area: ES|QL
4+
type: enhancement
5+
issues: []

docs/changelog/121256.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 121256
2+
summary: Run `TransportEnrichStatsAction` on local node
3+
area: Ingest Node
4+
type: enhancement
5+
issues: []

docs/changelog/121556.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 121556
2+
summary: Enable New Semantic Text Format Only On Newly Created Indices
3+
area: Mapping
4+
type: bug
5+
issues: []

docs/internal/Versioning.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ Every change to the transport protocol is represented by a new transport version
3535
higher than all previous transport versions, which then becomes the highest version
3636
recognized by that build of Elasticsearch. The version ids are stored
3737
as constants in the `TransportVersions` class.
38-
Each id has a standard pattern `M_NNN_SS_P`, where:
38+
Each id has a standard pattern `M_NNN_S_PP`, where:
3939
* `M` is the major version
4040
* `NNN` is an incrementing id
41-
* `SS` is used in subsidiary repos amending the default transport protocol
42-
* `P` is used for patches and backports
41+
* `S` is used in subsidiary repos amending the default transport protocol
42+
* `PP` is used for patches and backports
4343

4444
When you make a change to the serialization form of any object,
4545
you need to create a new sequential constant in `TransportVersions`,
4646
introduced in the same PR that adds the change, that increments
4747
the `NNN` component from the previous highest version,
4848
with other components set to zero.
49-
For example, if the previous version number is `8_413_00_1`,
50-
the next version number should be `8_414_00_0`.
49+
For example, if the previous version number is `8_413_0_01`,
50+
the next version number should be `8_414_0_00`.
5151

5252
Once you have defined your constant, you then need to use it
5353
in serialization code. If the transport version is at or above the new id,
@@ -166,7 +166,7 @@ also has that change, and knows about the patch backport ids and what they mean.
166166

167167
Index version is a single incrementing version number for the index data format,
168168
metadata, and associated mappings. It is declared the same way as the
169-
transport version - with the pattern `M_NNN_SS_P`, for the major version, version id,
169+
transport version - with the pattern `M_NNN_S_PP`, for the major version, version id,
170170
subsidiary version id, and patch number respectively.
171171

172172
Index version is stored in index metadata when an index is created,

libs/entitlement/asm-provider/src/main/java/org/elasticsearch/entitlement/instrumentation/impl/InstrumentationServiceImpl.java

Lines changed: 60 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -23,49 +23,86 @@
2323
import java.io.IOException;
2424
import java.lang.reflect.Method;
2525
import java.lang.reflect.Modifier;
26+
import java.util.ArrayDeque;
2627
import java.util.Arrays;
28+
import java.util.Collections;
2729
import java.util.HashMap;
30+
import java.util.HashSet;
2831
import java.util.List;
2932
import java.util.Locale;
3033
import java.util.Map;
34+
import java.util.Set;
3135
import java.util.stream.Collectors;
3236
import java.util.stream.Stream;
3337

3438
public class InstrumentationServiceImpl implements InstrumentationService {
3539

40+
private static final String OBJECT_INTERNAL_NAME = Type.getInternalName(Object.class);
41+
3642
@Override
3743
public Instrumenter newInstrumenter(Class<?> clazz, Map<MethodKey, CheckMethod> methods) {
3844
return InstrumenterImpl.create(clazz, methods);
3945
}
4046

4147
@Override
4248
public Map<MethodKey, CheckMethod> lookupMethods(Class<?> checkerClass) throws IOException {
43-
var methodsToInstrument = new HashMap<MethodKey, CheckMethod>();
44-
var classFileInfo = InstrumenterImpl.getClassFileInfo(checkerClass);
45-
ClassReader reader = new ClassReader(classFileInfo.bytecodes());
46-
ClassVisitor visitor = new ClassVisitor(Opcodes.ASM9) {
47-
@Override
48-
public MethodVisitor visitMethod(
49-
int access,
50-
String checkerMethodName,
51-
String checkerMethodDescriptor,
52-
String signature,
53-
String[] exceptions
54-
) {
55-
var mv = super.visitMethod(access, checkerMethodName, checkerMethodDescriptor, signature, exceptions);
56-
if (checkerMethodName.startsWith(InstrumentationService.CHECK_METHOD_PREFIX)) {
57-
var checkerMethodArgumentTypes = Type.getArgumentTypes(checkerMethodDescriptor);
58-
var methodToInstrument = parseCheckerMethodSignature(checkerMethodName, checkerMethodArgumentTypes);
49+
Map<MethodKey, CheckMethod> methodsToInstrument = new HashMap<>();
5950

60-
var checkerParameterDescriptors = Arrays.stream(checkerMethodArgumentTypes).map(Type::getDescriptor).toList();
61-
var checkMethod = new CheckMethod(Type.getInternalName(checkerClass), checkerMethodName, checkerParameterDescriptors);
51+
Set<Class<?>> visitedClasses = new HashSet<>();
52+
ArrayDeque<Class<?>> classesToVisit = new ArrayDeque<>(Collections.singleton(checkerClass));
53+
while (classesToVisit.isEmpty() == false) {
54+
var currentClass = classesToVisit.remove();
55+
if (visitedClasses.contains(currentClass)) {
56+
continue;
57+
}
58+
visitedClasses.add(currentClass);
6259

63-
methodsToInstrument.put(methodToInstrument, checkMethod);
60+
var classFileInfo = InstrumenterImpl.getClassFileInfo(currentClass);
61+
ClassReader reader = new ClassReader(classFileInfo.bytecodes());
62+
ClassVisitor visitor = new ClassVisitor(Opcodes.ASM9) {
63+
64+
@Override
65+
public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
66+
super.visit(version, access, name, signature, superName, interfaces);
67+
try {
68+
if (OBJECT_INTERNAL_NAME.equals(superName) == false) {
69+
classesToVisit.add(Class.forName(Type.getObjectType(superName).getClassName()));
70+
}
71+
for (var interfaceName : interfaces) {
72+
classesToVisit.add(Class.forName(Type.getObjectType(interfaceName).getClassName()));
73+
}
74+
} catch (ClassNotFoundException e) {
75+
throw new IllegalArgumentException("Cannot inspect checker class " + checkerClass.getName(), e);
76+
}
6477
}
65-
return mv;
66-
}
67-
};
68-
reader.accept(visitor, 0);
78+
79+
@Override
80+
public MethodVisitor visitMethod(
81+
int access,
82+
String checkerMethodName,
83+
String checkerMethodDescriptor,
84+
String signature,
85+
String[] exceptions
86+
) {
87+
var mv = super.visitMethod(access, checkerMethodName, checkerMethodDescriptor, signature, exceptions);
88+
if (checkerMethodName.startsWith(InstrumentationService.CHECK_METHOD_PREFIX)) {
89+
var checkerMethodArgumentTypes = Type.getArgumentTypes(checkerMethodDescriptor);
90+
var methodToInstrument = parseCheckerMethodSignature(checkerMethodName, checkerMethodArgumentTypes);
91+
92+
var checkerParameterDescriptors = Arrays.stream(checkerMethodArgumentTypes).map(Type::getDescriptor).toList();
93+
var checkMethod = new CheckMethod(
94+
Type.getInternalName(currentClass),
95+
checkerMethodName,
96+
checkerParameterDescriptors
97+
);
98+
99+
methodsToInstrument.putIfAbsent(methodToInstrument, checkMethod);
100+
}
101+
return mv;
102+
}
103+
};
104+
reader.accept(visitor, 0);
105+
}
69106
return methodsToInstrument;
70107
}
71108

0 commit comments

Comments
 (0)