Skip to content

Commit 256d104

Browse files
committed
Merge branch 'fix-hdfs-tests-java24' of github.com:ldematte/elasticsearch into fix-hdfs-tests-java24
2 parents cecb60b + ec9e749 commit 256d104

File tree

29 files changed

+219
-100
lines changed

29 files changed

+219
-100
lines changed

docs/changelog/122458.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 122458
2+
summary: '`DesiredBalanceReconciler` always returns `AllocationStats`'
3+
area: Allocation
4+
type: bug
5+
issues: []

docs/changelog/122731.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 122731
2+
summary: Fork post-snapshot-delete cleanup off master thread
3+
area: Snapshot/Restore
4+
type: bug
5+
issues: []

libs/core/src/main/java/org/elasticsearch/core/UpdateForV9.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,11 @@
2424
enum Owner {
2525
CORE_INFRA,
2626
DATA_MANAGEMENT,
27-
DISTRIBUTED_COORDINATION,
2827
DISTRIBUTED_INDEXING,
2928
ENTERPRISE_SEARCH,
3029
MACHINE_LEARNING,
3130
PROFILING,
3231
SEARCH_ANALYTICS,
33-
SEARCH_FOUNDATIONS,
34-
SEARCH_RELEVANCE,
3532
SECURITY,
3633
}
3734

libs/entitlement/asm-provider/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ apply plugin: 'elasticsearch.build'
1212
dependencies {
1313
compileOnly project(':libs:entitlement')
1414
compileOnly project(':libs:core')
15+
compileOnly project(':libs:logging')
1516
implementation 'org.ow2.asm:asm:9.7.1'
1617
testImplementation project(":test:framework")
1718
testImplementation project(":libs:entitlement:bridge")

libs/entitlement/asm-provider/src/main/java/module-info.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
requires org.elasticsearch.entitlement;
1616

1717
requires static org.elasticsearch.base; // for SuppressForbidden
18+
requires org.elasticsearch.logging;
1819

1920
provides InstrumentationService with InstrumentationServiceImpl;
2021
}

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
import org.elasticsearch.entitlement.instrumentation.CheckMethod;
1313
import org.elasticsearch.entitlement.instrumentation.Instrumenter;
1414
import org.elasticsearch.entitlement.instrumentation.MethodKey;
15+
import org.elasticsearch.logging.LogManager;
16+
import org.elasticsearch.logging.Logger;
1517
import org.objectweb.asm.AnnotationVisitor;
1618
import org.objectweb.asm.ClassReader;
1719
import org.objectweb.asm.ClassVisitor;
@@ -36,6 +38,7 @@
3638
import static org.objectweb.asm.Opcodes.INVOKEVIRTUAL;
3739

3840
public class InstrumenterImpl implements Instrumenter {
41+
private static final Logger logger = LogManager.getLogger(InstrumenterImpl.class);
3942

4043
private final String getCheckerClassMethodDescriptor;
4144
private final String handleClass;
@@ -155,10 +158,10 @@ public MethodVisitor visitMethod(int access, String name, String descriptor, Str
155158
var key = new MethodKey(className, name, Stream.of(Type.getArgumentTypes(descriptor)).map(Type::getInternalName).toList());
156159
var instrumentationMethod = checkMethods.get(key);
157160
if (instrumentationMethod != null) {
158-
// System.out.println("Will instrument method " + key);
161+
logger.debug("Will instrument {}", key);
159162
return new EntitlementMethodVisitor(Opcodes.ASM9, mv, isStatic, isCtor, descriptor, instrumentationMethod);
160163
} else {
161-
// System.out.println("Will not instrument method " + key);
164+
logger.trace("Will not instrument {}", key);
162165
}
163166
}
164167
return mv;

muted-tests.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ tests:
6161
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
6262
method: test {p0=transform/transforms_start_stop/Verify start transform reuses destination index}
6363
issue: https://github.com/elastic/elasticsearch/issues/115808
64-
- class: org.elasticsearch.search.StressSearchServiceReaperIT
65-
method: testStressReaper
66-
issue: https://github.com/elastic/elasticsearch/issues/115816
6764
- class: org.elasticsearch.xpack.application.connector.ConnectorIndexServiceTests
6865
issue: https://github.com/elastic/elasticsearch/issues/116087
6966
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
@@ -323,6 +320,8 @@ tests:
323320
- class: org.elasticsearch.xpack.esql.heap_attack.HeapAttackIT
324321
method: testEnrichExplosionManyMatches
325322
issue: https://github.com/elastic/elasticsearch/issues/122913
323+
- class: org.elasticsearch.xpack.search.AsyncSearchSecurityIT
324+
issue: https://github.com/elastic/elasticsearch/issues/122940
326325

327326
# Examples:
328327
#

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/snapshot.delete/10_basic.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,10 @@ setup:
6868
wait_for_completion: false
6969

7070
- match: { acknowledged: true }
71+
72+
# now create another snapshot just to ensure that the async delete finishes before the test cleanup runs:
73+
- do:
74+
snapshot.create:
75+
repository: test_repo_create_1
76+
snapshot: barrier_snapshot
77+
wait_for_completion: true

server/src/internalClusterTest/java/org/elasticsearch/snapshots/RepositoriesIT.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,12 @@ public void taskSucceeded(ClusterStateTaskListener clusterStateTaskListener, Obj
508508
.orElseThrow()
509509
.queue();
510510

511+
// There is one task in the queue for computing and forking the cleanup work.
512+
assertThat(queueLength.getAsInt(), equalTo(1));
513+
514+
safeAwait(barrier); // unblock the barrier thread and let it process the queue
515+
safeAwait(barrier); // wait for the queue to be processed
516+
511517
// There are indexCount (=3*snapshotPoolSize) index-deletion tasks, plus one for cleaning up the root metadata. However, the
512518
// throttled runner only enqueues one task per SNAPSHOT thread to start with, and then the eager runner adds another one. This shows
513519
// we are not spamming the threadpool with all the tasks at once, which means that other snapshot activities can run alongside this

server/src/main/java/org/elasticsearch/cluster/routing/RoutingNode.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ public String nodeId() {
112112
return this.nodeId;
113113
}
114114

115+
/**
116+
* Number of shards assigned to this node. Includes relocating shards. Use {@link #numberOfOwningShards()} to exclude relocating shards.
117+
*/
115118
public int size() {
116119
return shards.size();
117120
}

0 commit comments

Comments
 (0)