Skip to content

Commit f39aba4

Browse files
authored
Remove LongGCDisruption scheme (#115046) (#115443)
Long GC disruption relies on Thread.resume, which is removed in JDK 23. Tests that use it predate more modern disruption tests. This commit removes gc disruption and the master disruption tests. Note that tests relying on this scheme have already not been running since JDK 20 first deprecated Thread.resume.
1 parent 27c240a commit f39aba4

File tree

5 files changed

+0
-1032
lines changed

5 files changed

+0
-1032
lines changed

server/src/internalClusterTest/java/org/elasticsearch/discovery/MasterDisruptionIT.java

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -21,66 +21,22 @@
2121
import org.elasticsearch.core.TimeValue;
2222
import org.elasticsearch.test.ESIntegTestCase;
2323
import org.elasticsearch.test.disruption.BlockMasterServiceOnMaster;
24-
import org.elasticsearch.test.disruption.IntermittentLongGCDisruption;
2524
import org.elasticsearch.test.disruption.NetworkDisruption;
2625
import org.elasticsearch.test.disruption.NetworkDisruption.TwoPartitions;
2726
import org.elasticsearch.test.disruption.ServiceDisruptionScheme;
28-
import org.elasticsearch.test.disruption.SingleNodeDisruption;
2927
import org.elasticsearch.xcontent.XContentType;
3028

31-
import java.util.ArrayList;
32-
import java.util.HashSet;
3329
import java.util.List;
34-
import java.util.Set;
3530

3631
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
3732
import static org.hamcrest.Matchers.equalTo;
38-
import static org.hamcrest.Matchers.not;
3933

4034
/**
4135
* Tests relating to the loss of the master.
4236
*/
4337
@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST, numDataNodes = 0)
4438
public class MasterDisruptionIT extends AbstractDisruptionTestCase {
4539

46-
/**
47-
* Test that cluster recovers from a long GC on master that causes other nodes to elect a new one
48-
*/
49-
public void testMasterNodeGCs() throws Exception {
50-
List<String> nodes = startCluster(3);
51-
// NOTE: this assume must happen after starting the cluster, so that cleanup will have something to cleanup.
52-
assumeFalse("jdk20 removed thread suspend/resume", Runtime.version().feature() >= 20);
53-
54-
String oldMasterNode = internalCluster().getMasterName();
55-
// a very long GC, but it's OK as we remove the disruption when it has had an effect
56-
SingleNodeDisruption masterNodeDisruption = new IntermittentLongGCDisruption(random(), oldMasterNode, 100, 200, 30000, 60000);
57-
internalCluster().setDisruptionScheme(masterNodeDisruption);
58-
masterNodeDisruption.startDisrupting();
59-
60-
Set<String> oldNonMasterNodesSet = new HashSet<>(nodes);
61-
oldNonMasterNodesSet.remove(oldMasterNode);
62-
63-
List<String> oldNonMasterNodes = new ArrayList<>(oldNonMasterNodesSet);
64-
65-
logger.info("waiting for nodes to de-elect master [{}]", oldMasterNode);
66-
for (String node : oldNonMasterNodesSet) {
67-
assertDifferentMaster(node, oldMasterNode);
68-
}
69-
70-
logger.info("waiting for nodes to elect a new master");
71-
ensureStableCluster(2, oldNonMasterNodes.get(0));
72-
73-
// restore GC
74-
masterNodeDisruption.stopDisrupting();
75-
final TimeValue waitTime = new TimeValue(DISRUPTION_HEALING_OVERHEAD.millis() + masterNodeDisruption.expectedTimeToHeal().millis());
76-
ensureStableCluster(3, waitTime, false, oldNonMasterNodes.get(0));
77-
78-
// make sure all nodes agree on master
79-
String newMaster = internalCluster().getMasterName();
80-
assertThat(newMaster, not(equalTo(oldMasterNode)));
81-
assertMaster(newMaster, nodes);
82-
}
83-
8440
/**
8541
* This test isolates the master from rest of the cluster, waits for a new master to be elected, restores the partition
8642
* and verifies that all node agree on the new cluster state

0 commit comments

Comments
 (0)