Skip to content

Commit edcbed4

Browse files
retashiv0408
authored andcommitted
OpenJDK Update (April 2023 Patch releases) (opensearch-project#7344)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io> Signed-off-by: Shivansh Arora <hishiv@amazon.com>
1 parent 4b9a68a commit edcbed4

File tree

11 files changed

+67
-17
lines changed

11 files changed

+67
-17
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4242
- Bump `com.diffplug.spotless` from 6.17.0 to 6.18.0
4343
- Bump `io.opencensus:opencensus-api` from 0.18.0 to 0.31.1 ([#7291](https://github.com/opensearch-project/OpenSearch/pull/7291))
4444
- Add `com.github.luben:zstd-jni` version 1.5.5-3 ([#2996](https://github.com/opensearch-project/OpenSearch/pull/2996))
45+
- OpenJDK Update (April 2023 Patch releases) ([#7344](https://github.com/opensearch-project/OpenSearch/pull/7344)
4546

4647
### Changed
4748
- [CCR] Add getHistoryOperationsFromTranslog method to fetch the history snapshot from translogs ([#3948](https://github.com/opensearch-project/OpenSearch/pull/3948))

buildSrc/src/main/java/org/opensearch/gradle/JdkDownloadPlugin.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,9 @@ private void setupRepository(Project project, Jdk jdk) {
129129
// To distinguish between those, the GA releases have only major version component (fe 17+32),
130130
// the updates always have minor/patch components (fe 17.0.1+12), checking for the presence of
131131
// version separator '.' should be enough.
132-
artifactPattern = "jdk-"
133-
+ jdk.getBaseVersion()
134-
+ "+"
135-
+ jdk.getBuild()
136-
+ "/OpenJDK"
137-
+ jdk.getMajor()
138-
+ (jdk.getBaseVersion().contains(".") ? "U" : "")
132+
artifactPattern = "jdk-" + jdk.getBaseVersion() + "+" + jdk.getBuild() + "/OpenJDK" + jdk.getMajor()
133+
// JDK-20 does use 'U' suffix all the time, no matter it is update or GA release
134+
+ (jdk.getBaseVersion().contains(".") || jdk.getBaseVersion().matches("^2\\d+$") ? "U" : "")
139135
+ "-jdk_[classifier]_[module]_hotspot_"
140136
+ jdk.getBaseVersion()
141137
+ "_"

buildSrc/src/main/java/org/opensearch/gradle/VersionProperties.java

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131

3232
package org.opensearch.gradle;
3333

34+
import org.apache.commons.lang3.StringUtils;
35+
3436
import java.io.IOException;
3537
import java.io.InputStream;
3638
import java.util.HashMap;
@@ -54,22 +56,26 @@ public static String getLucene() {
5456
return lucene;
5557
}
5658

57-
public static String getBundledJdk(final String platform) {
59+
public static String getBundledJdk(final String platform, final String arch) {
5860
switch (platform) {
5961
case "darwin": // fall trough
6062
case "mac":
6163
return bundledJdkDarwin;
6264
case "freebsd":
6365
return bundledJdkFreeBSD;
6466
case "linux":
65-
return bundledJdkLinux;
67+
return getBundledJdkLinux(arch);
6668
case "windows":
6769
return bundledJdkWindows;
6870
default:
6971
throw new IllegalArgumentException("unknown platform [" + platform + "]");
7072
}
7173
}
7274

75+
public static String getBundledJdk(final String platform) {
76+
return getBundledJdk(platform, null);
77+
}
78+
7379
public static String getBundledJdkVendor() {
7480
return bundledJdkVendor;
7581
}
@@ -84,6 +90,10 @@ public static Map<String, String> getVersions() {
8490
private static final String bundledJdkFreeBSD;
8591
private static final String bundledJdkLinux;
8692
private static final String bundledJdkWindows;
93+
private static final String bundledJdkLinux_arm64;
94+
private static final String bundledJdkLinux_x64;
95+
private static final String bundledJdkLinux_s390x;
96+
private static final String bundledJdkLinux_ppc64le;
8797
private static final String bundledJdkVendor;
8898
private static final Map<String, String> versions = new HashMap<String, String>();
8999

@@ -98,6 +108,12 @@ public static Map<String, String> getVersions() {
98108
bundledJdkLinux = props.getProperty("bundled_jdk_linux", bundledJdk);
99109
bundledJdkWindows = props.getProperty("bundled_jdk_windows", bundledJdk);
100110

111+
// Bundled JDKs per architecture (linux platform)
112+
bundledJdkLinux_arm64 = props.getProperty("bundled_jdk_linux_arm64", bundledJdkLinux);
113+
bundledJdkLinux_x64 = props.getProperty("bundled_jdk_linux_x64", bundledJdkLinux);
114+
bundledJdkLinux_s390x = props.getProperty("bundled_jdk_linux_s390x", bundledJdkLinux);
115+
bundledJdkLinux_ppc64le = props.getProperty("bundled_jdk_linux_ppc64le", bundledJdkLinux);
116+
101117
for (String property : props.stringPropertyNames()) {
102118
versions.put(property, props.getProperty(property));
103119
}
@@ -119,4 +135,24 @@ private static Properties getVersionProperties() {
119135
public static boolean isOpenSearchSnapshot() {
120136
return opensearch.endsWith("-SNAPSHOT");
121137
}
138+
139+
private static String getBundledJdkLinux(String arch) {
140+
if (StringUtils.isBlank(arch)) {
141+
return bundledJdkLinux;
142+
}
143+
144+
switch (arch) {
145+
case "aarch64":
146+
case "arm64":
147+
return bundledJdkLinux_arm64;
148+
case "x64":
149+
return bundledJdkLinux_x64;
150+
case "s390x":
151+
return bundledJdkLinux_s390x;
152+
case "ppc64le":
153+
return bundledJdkLinux_ppc64le;
154+
default:
155+
throw new IllegalArgumentException("unknown platform [" + arch + "] for 'linux' platform");
156+
}
157+
}
122158
}

buildSrc/src/main/java/org/opensearch/gradle/test/DistroTestPlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@
7575
import java.util.stream.Stream;
7676

7777
public class DistroTestPlugin implements Plugin<Project> {
78-
private static final String SYSTEM_JDK_VERSION = "11.0.18+10";
78+
private static final String SYSTEM_JDK_VERSION = "11.0.19+7";
7979
private static final String SYSTEM_JDK_VENDOR = "adoptium";
80-
private static final String GRADLE_JDK_VERSION = "17.0.6+10";
80+
private static final String GRADLE_JDK_VERSION = "17.0.7+7";
8181
private static final String GRADLE_JDK_VENDOR = "adoptium";
8282

8383
// all distributions used by distro tests. this is temporary until tests are per distribution

buildSrc/version.properties

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ opensearch = 3.0.0
22
lucene = 9.7.0-snapshot-4d1ed9e
33

44
bundled_jdk_vendor = adoptium
5-
bundled_jdk = 19.0.2+7
6-
5+
bundled_jdk = 20.0.1+9
6+
# See please https://github.com/adoptium/temurin-build/issues/3371
7+
bundled_jdk_linux_ppc64le = 20+36
78

89
# optional dependencies
910
spatial4j = 0.7

distribution/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
283283
(platform == 'linux' || platform == 'darwin' ? ['x64', 'aarch64', 's390x', 'ppc64le'] : ['x64']).each { architecture ->
284284
"bundled_${platform}_${architecture}" {
285285
it.platform = platform
286-
it.version = VersionProperties.getBundledJdk(platform)
286+
it.version = VersionProperties.getBundledJdk(platform, architecture)
287287
it.vendor = VersionProperties.bundledJdkVendor
288288
it.architecture = architecture
289289
}

gradle/runtime-jdk-provision.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ if (BuildParams.getIsRuntimeJavaHomeSet()) {
3232
jdks {
3333
provisioned_runtime {
3434
vendor = VersionProperties.bundledJdkVendor
35-
version = VersionProperties.getBundledJdk(OS.current().name().toLowerCase())
35+
version = VersionProperties.getBundledJdk(OS.current().name().toLowerCase(), Architecture.current().name().toLowerCase())
3636
platform = OS.current().name().toLowerCase()
3737
architecture = Architecture.current().name().toLowerCase()
3838
}

server/src/internalClusterTest/java/org/opensearch/discovery/ClusterManagerDisruptionIT.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@
5757

5858
import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertAcked;
5959
import static org.hamcrest.Matchers.equalTo;
60+
import static org.hamcrest.Matchers.lessThan;
6061
import static org.hamcrest.Matchers.not;
62+
import static org.junit.Assume.assumeThat;
6163

6264
/**
6365
* Tests relating to the loss of the cluster-manager.
@@ -70,6 +72,7 @@ public class ClusterManagerDisruptionIT extends AbstractDisruptionTestCase {
7072
*/
7173
public void testClusterManagerNodeGCs() throws Exception {
7274
List<String> nodes = startCluster(3);
75+
assumeThat("Thread::resume / Thread::suspend are not supported anymore", Runtime.version(), lessThan(Runtime.Version.parse("20")));
7376

7477
String oldClusterManagerNode = internalCluster().getClusterManagerName();
7578
// a very long GC, but it's OK as we remove the disruption when it has had an effect
@@ -81,6 +84,7 @@ public void testClusterManagerNodeGCs() throws Exception {
8184
30000,
8285
60000
8386
);
87+
8488
internalCluster().setDisruptionScheme(clusterManagerNodeDisruption);
8589
clusterManagerNodeDisruption.startDisrupting();
8690

server/src/internalClusterTest/java/org/opensearch/discovery/StableClusterManagerDisruptionIT.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@
7171

7272
import static java.util.Collections.singleton;
7373
import static org.hamcrest.Matchers.equalTo;
74+
import static org.hamcrest.Matchers.lessThan;
75+
import static org.junit.Assume.assumeThat;
7476

7577
/**
7678
* Tests relating to the loss of the cluster-manager, but which work with the default fault detection settings which are rather lenient and will
@@ -195,6 +197,8 @@ private void testFollowerCheckerAfterClusterManagerReelection(NetworkLinkDisrupt
195197
* following another elected cluster-manager node. These nodes should reject this cluster state and prevent them from following the stale cluster-manager.
196198
*/
197199
public void testStaleClusterManagerNotHijackingMajority() throws Exception {
200+
assumeThat("Thread::resume / Thread::suspend are not supported anymore", Runtime.version(), lessThan(Runtime.Version.parse("20")));
201+
198202
final List<String> nodes = internalCluster().startNodes(
199203
3,
200204
Settings.builder()

server/src/main/java/org/opensearch/common/util/concurrent/BaseFuture.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public abstract class BaseFuture<V> implements Future<V> {
7474
*
7575
* @throws InterruptedException if the current thread was interrupted before
7676
* or during the call (optional but recommended).
77-
* @throws CancellationException {@inheritDoc}
77+
* @throws CancellationException if the computation was cancelled
7878
*/
7979
@Override
8080
public V get(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException, ExecutionException {
@@ -96,7 +96,7 @@ public V get(long timeout, TimeUnit unit) throws InterruptedException, TimeoutEx
9696
*
9797
* @throws InterruptedException if the current thread was interrupted before
9898
* or during the call (optional but recommended).
99-
* @throws CancellationException {@inheritDoc}
99+
* @throws CancellationException if the computation was cancelled
100100
*/
101101
@Override
102102
public V get() throws InterruptedException, ExecutionException {

test/framework/src/test/java/org/opensearch/test/disruption/LongGCDisruptionTests.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,11 @@
4545
import java.util.concurrent.locks.ReentrantLock;
4646
import java.util.regex.Pattern;
4747

48+
import static org.junit.Assume.assumeThat;
4849
import static org.hamcrest.Matchers.containsString;
4950
import static org.hamcrest.Matchers.equalTo;
5051
import static org.hamcrest.Matchers.greaterThan;
52+
import static org.hamcrest.Matchers.lessThan;
5153

5254
public class LongGCDisruptionTests extends OpenSearchTestCase {
5355

@@ -65,6 +67,8 @@ public void executeLocked(Runnable r) {
6567
}
6668

6769
public void testBlockingTimeout() throws Exception {
70+
assumeThat("Thread::resume / Thread::suspend are not supported anymore", Runtime.version(), lessThan(Runtime.Version.parse("20")));
71+
6872
final String nodeName = "test_node";
6973
LongGCDisruption disruption = new LongGCDisruption(random(), nodeName) {
7074
@Override
@@ -125,6 +129,8 @@ protected long getSuspendingTimeoutInMillis() {
125129
* but does keep retrying until all threads can be safely paused
126130
*/
127131
public void testNotBlockingUnsafeStackTraces() throws Exception {
132+
assumeThat("Thread::resume / Thread::suspend are not supported anymore", Runtime.version(), lessThan(Runtime.Version.parse("20")));
133+
128134
final String nodeName = "test_node";
129135
LongGCDisruption disruption = new LongGCDisruption(random(), nodeName) {
130136
@Override
@@ -179,6 +185,8 @@ protected Pattern[] getUnsafeClasses() {
179185
}
180186

181187
public void testBlockDetection() throws Exception {
188+
assumeThat("Thread::resume / Thread::suspend are not supported anymore", Runtime.version(), lessThan(Runtime.Version.parse("20")));
189+
182190
final String disruptedNodeName = "disrupted_node";
183191
final String blockedNodeName = "blocked_node";
184192
CountDownLatch waitForBlockDetectionResult = new CountDownLatch(1);

0 commit comments

Comments
 (0)