Browse Source

Remove no-jdk deprecations (#85765)

The no-jdk distributions exist in 7.x and before. They were removed with
8.0. This commit removes the remaining deprecation messages for using
the no-jdk distribution. Note that when talking with an older node, we
drop the bundledJdk attribute. This is ok because it is only possible
for this to not be true when talking with a 7.17 node, during an upgrade,
and the usingBundledJdk is retained, which is the important thing if
debugging a problem.

relates #76896
relates #85758
Ryan Ernst 3 years ago
parent
commit
cf3dc57132

+ 0 - 1
benchmarks/src/main/resources/org/elasticsearch/benchmark/xcontent/monitor_cluster_stats.json

@@ -262,7 +262,6 @@
             "vm_name" : "OpenJDK 64-Bit Server VM",
             "vm_version" : "11.0.7.7",
             "vm_vendor" : "OpenJDK",
-            "bundled_jdk" : false,
             "using_bundled_jdk" : null,
             "count" : 15
           }

+ 0 - 4
distribution/build.gradle

@@ -527,10 +527,6 @@ subprojects {
         'zip': 'zip'
       ],
 
-      'es.bundled_jdk': [
-        'def': 'true'
-      ],
-
       'license.name': [
         'deb': 'Elastic-License'
       ],

+ 0 - 2
distribution/src/bin/elasticsearch

@@ -116,7 +116,6 @@ if [[ $DAEMONIZE = false ]]; then
     -Des.path.conf="$ES_PATH_CONF" \
     -Des.distribution.flavor="$ES_DISTRIBUTION_FLAVOR" \
     -Des.distribution.type="$ES_DISTRIBUTION_TYPE" \
-    -Des.bundled_jdk="$ES_BUNDLED_JDK" \
     -cp "$ES_CLASSPATH" \
     org.elasticsearch.bootstrap.Elasticsearch \
     "${ARG_LIST[@]}" <<<"$KEYSTORE_PASSWORD"
@@ -128,7 +127,6 @@ else
     -Des.path.conf="$ES_PATH_CONF" \
     -Des.distribution.flavor="$ES_DISTRIBUTION_FLAVOR" \
     -Des.distribution.type="$ES_DISTRIBUTION_TYPE" \
-    -Des.bundled_jdk="$ES_BUNDLED_JDK" \
     -cp "$ES_CLASSPATH" \
     org.elasticsearch.bootstrap.Elasticsearch \
     "${ARG_LIST[@]}" \

+ 0 - 5
distribution/src/bin/elasticsearch-env

@@ -91,11 +91,6 @@ ES_PATH_CONF=`cd "$ES_PATH_CONF"; pwd`
 
 ES_DISTRIBUTION_FLAVOR=@es.distribution.flavor@
 ES_DISTRIBUTION_TYPE=@es.distribution.type@
-ES_BUNDLED_JDK=@es.bundled_jdk@
-
-if [[ "$ES_BUNDLED_JDK" == "false" ]]; then
-  echo "warning: no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release" >&2
-fi
 
 if [[ "$ES_DISTRIBUTION_TYPE" == "docker" ]]; then
   # Allow environment variables to be set by creating a file with the

+ 0 - 5
distribution/src/bin/elasticsearch-env.bat

@@ -28,11 +28,6 @@ for %%I in ("%ES_PATH_CONF%..") do set ES_PATH_CONF=%%~dpfI
 
 set ES_DISTRIBUTION_FLAVOR=@es.distribution.flavor@
 set ES_DISTRIBUTION_TYPE=@es.distribution.type@
-set ES_BUNDLED_JDK=@es.bundled_jdk@
-
-if "%ES_BUNDLED_JDK%" == "false" (
-  echo "warning: no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release" >&2
-)
 
 cd /d "%ES_HOME%"
 

+ 1 - 1
distribution/src/bin/elasticsearch-service.bat

@@ -194,7 +194,7 @@ if "%JVM_SS%" == "" (
 set OTHER_JAVA_OPTS=%OTHER_JAVA_OPTS:"=%
 set OTHER_JAVA_OPTS=%OTHER_JAVA_OPTS:~1%
 
-set ES_PARAMS=-Delasticsearch;-Des.path.home="%ES_HOME%";-Des.path.conf="%ES_PATH_CONF%";-Des.distribution.flavor="%ES_DISTRIBUTION_FLAVOR%";-Des.distribution.type="%ES_DISTRIBUTION_TYPE%";-Des.bundled_jdk="%ES_BUNDLED_JDK%"
+set ES_PARAMS=-Delasticsearch;-Des.path.home="%ES_HOME%";-Des.path.conf="%ES_PATH_CONF%";-Des.distribution.flavor="%ES_DISTRIBUTION_FLAVOR%";-Des.distribution.type="%ES_DISTRIBUTION_TYPE%"
 
 if "%ES_START_TYPE%" == "" set ES_START_TYPE=manual
 if "%ES_STOP_TIMEOUT%" == "" set ES_STOP_TIMEOUT=0

+ 0 - 1
distribution/src/bin/elasticsearch.bat

@@ -156,7 +156,6 @@ ECHO.!KEYSTORE_PASSWORD!| %JAVA% %ES_JAVA_OPTS% -Delasticsearch ^
   -Des.path.home="%ES_HOME%" -Des.path.conf="%ES_PATH_CONF%" ^
   -Des.distribution.flavor="%ES_DISTRIBUTION_FLAVOR%" ^
   -Des.distribution.type="%ES_DISTRIBUTION_TYPE%" ^
-  -Des.bundled_jdk="%ES_BUNDLED_JDK%" ^
   -cp "%ES_CLASSPATH%" "org.elasticsearch.bootstrap.Elasticsearch" !newparams!
 
 endlocal

+ 1 - 1
docs/reference/cluster/stats.asciidoc

@@ -1041,7 +1041,7 @@ Vendor of the JVM.
 
 `bundled_jdk`::
 (Boolean)
-If `true`, the JVM includes a bundled Java Development Kit (JDK).
+Always `true`. All distributions come with a bundled Java Development Kit (JDK).
 
 `using_bundled_jdk`::
 (Boolean)

+ 1 - 3
server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodes.java

@@ -554,7 +554,7 @@ public class ClusterStatsNodes implements ToXContentFragment {
                 builder.field(Fields.VM_NAME, v.getKey().vmName);
                 builder.field(Fields.VM_VERSION, v.getKey().vmVersion);
                 builder.field(Fields.VM_VENDOR, v.getKey().vmVendor);
-                builder.field(Fields.BUNDLED_JDK, v.getKey().bundledJdk);
+                builder.field(Fields.BUNDLED_JDK, true); // bundled_jdk is retained for backcompat
                 builder.field(Fields.USING_BUNDLED_JDK, v.getKey().usingBundledJdk);
                 builder.field(Fields.COUNT, v.getValue());
                 builder.endObject();
@@ -575,7 +575,6 @@ public class ClusterStatsNodes implements ToXContentFragment {
         String vmName;
         String vmVersion;
         String vmVendor;
-        boolean bundledJdk;
         Boolean usingBundledJdk;
 
         JvmVersion(JvmInfo jvmInfo) {
@@ -583,7 +582,6 @@ public class ClusterStatsNodes implements ToXContentFragment {
             vmName = jvmInfo.getVmName();
             vmVersion = jvmInfo.getVmVersion();
             vmVendor = jvmInfo.getVmVendor();
-            bundledJdk = jvmInfo.getBundledJdk();
             usingBundledJdk = jvmInfo.getUsingBundledJdk();
         }
 

+ 9 - 17
server/src/main/java/org/elasticsearch/monitor/jvm/JvmInfo.java

@@ -9,11 +9,11 @@
 package org.elasticsearch.monitor.jvm;
 
 import org.apache.lucene.util.Constants;
+import org.elasticsearch.Version;
 import org.elasticsearch.common.io.stream.StreamInput;
 import org.elasticsearch.common.io.stream.StreamOutput;
 import org.elasticsearch.common.io.stream.Writeable;
 import org.elasticsearch.common.unit.ByteSizeValue;
-import org.elasticsearch.core.Booleans;
 import org.elasticsearch.core.PathUtils;
 import org.elasticsearch.core.SuppressForbidden;
 import org.elasticsearch.node.ReportingService;
@@ -141,17 +141,13 @@ public class JvmInfo implements ReportingService.Info {
 
         }
 
-        final boolean bundledJdk = Booleans.parseBoolean(System.getProperty("es.bundled_jdk", Boolean.FALSE.toString()));
-        final Boolean usingBundledJdk = bundledJdk ? usingBundledJdk() : null;
-
         INSTANCE = new JvmInfo(
             ProcessHandle.current().pid(),
             System.getProperty("java.version"),
             runtimeMXBean.getVmName(),
             runtimeMXBean.getVmVersion(),
             runtimeMXBean.getVmVendor(),
-            bundledJdk,
-            usingBundledJdk,
+            usingBundledJdk(),
             runtimeMXBean.getStartTime(),
             configuredInitialHeapSize,
             configuredMaxHeapSize,
@@ -200,7 +196,6 @@ public class JvmInfo implements ReportingService.Info {
     private final String vmName;
     private final String vmVersion;
     private final String vmVendor;
-    private final boolean bundledJdk;
     private final Boolean usingBundledJdk;
     private final long startTime;
     private final long configuredInitialHeapSize;
@@ -225,7 +220,6 @@ public class JvmInfo implements ReportingService.Info {
         String vmName,
         String vmVersion,
         String vmVendor,
-        boolean bundledJdk,
         Boolean usingBundledJdk,
         long startTime,
         long configuredInitialHeapSize,
@@ -249,7 +243,6 @@ public class JvmInfo implements ReportingService.Info {
         this.vmName = vmName;
         this.vmVersion = vmVersion;
         this.vmVendor = vmVendor;
-        this.bundledJdk = bundledJdk;
         this.usingBundledJdk = usingBundledJdk;
         this.startTime = startTime;
         this.configuredInitialHeapSize = configuredInitialHeapSize;
@@ -275,7 +268,10 @@ public class JvmInfo implements ReportingService.Info {
         vmName = in.readString();
         vmVersion = in.readString();
         vmVendor = in.readString();
-        bundledJdk = in.readBoolean();
+        if (in.getVersion().before(Version.V_8_3_0)) {
+            // Before 8.0 the no-jdk distributions could have bundledJdk false, this is always true now.
+            in.readBoolean();
+        }
         usingBundledJdk = in.readOptionalBoolean();
         startTime = in.readLong();
         inputArguments = new String[in.readInt()];
@@ -306,7 +302,9 @@ public class JvmInfo implements ReportingService.Info {
         out.writeString(vmName);
         out.writeString(vmVersion);
         out.writeString(vmVendor);
-        out.writeBoolean(bundledJdk);
+        if (out.getVersion().before(Version.V_8_3_0)) {
+            out.writeBoolean(true);
+        }
         out.writeOptionalBoolean(usingBundledJdk);
         out.writeLong(startTime);
         out.writeInt(inputArguments.length);
@@ -422,10 +420,6 @@ public class JvmInfo implements ReportingService.Info {
         return this.vmVendor;
     }
 
-    public boolean getBundledJdk() {
-        return bundledJdk;
-    }
-
     public Boolean getUsingBundledJdk() {
         return usingBundledJdk;
     }
@@ -510,7 +504,6 @@ public class JvmInfo implements ReportingService.Info {
         builder.field(Fields.VM_NAME, vmName);
         builder.field(Fields.VM_VERSION, vmVersion);
         builder.field(Fields.VM_VENDOR, vmVendor);
-        builder.field(Fields.BUNDLED_JDK, bundledJdk);
         builder.field(Fields.USING_BUNDLED_JDK, usingBundledJdk);
         builder.timeField(Fields.START_TIME_IN_MILLIS, Fields.START_TIME, startTime);
 
@@ -540,7 +533,6 @@ public class JvmInfo implements ReportingService.Info {
         static final String VM_NAME = "vm_name";
         static final String VM_VERSION = "vm_version";
         static final String VM_VENDOR = "vm_vendor";
-        static final String BUNDLED_JDK = "bundled_jdk";
         static final String USING_BUNDLED_JDK = "using_bundled_jdk";
         static final String START_TIME = "start_time";
         static final String START_TIME_IN_MILLIS = "start_time_in_millis";

+ 1 - 10
server/src/main/java/org/elasticsearch/node/Node.java

@@ -332,16 +332,7 @@ public class Node implements Closeable {
                 Constants.JAVA_VERSION,
                 Constants.JVM_VERSION
             );
-            if (jvmInfo.getBundledJdk()) {
-                logger.info("JVM home [{}], using bundled JDK [{}]", System.getProperty("java.home"), jvmInfo.getUsingBundledJdk());
-            } else {
-                logger.info("JVM home [{}]", System.getProperty("java.home"));
-                deprecationLogger.warn(
-                    DeprecationCategory.OTHER,
-                    "no-jdk",
-                    "no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release"
-                );
-            }
+            logger.info("JVM home [{}], using bundled JDK [{}]", System.getProperty("java.home"), jvmInfo.getUsingBundledJdk());
             logger.info("JVM arguments {}", Arrays.toString(jvmInfo.getInputArguments()));
             if (Build.CURRENT.isProductionRelease() == false) {
                 logger.warn(

+ 0 - 4
test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java

@@ -85,7 +85,6 @@ import org.elasticsearch.index.analysis.TokenFilterFactory;
 import org.elasticsearch.index.analysis.TokenizerFactory;
 import org.elasticsearch.indices.IndicesModule;
 import org.elasticsearch.indices.analysis.AnalysisModule;
-import org.elasticsearch.monitor.jvm.JvmInfo;
 import org.elasticsearch.plugins.AnalysisPlugin;
 import org.elasticsearch.plugins.Plugin;
 import org.elasticsearch.script.MockScriptEngine;
@@ -475,9 +474,6 @@ public abstract class ESTestCase extends LuceneTestCase {
         );
         filtered.add("Configuring [path.data] with a list is deprecated. Instead specify as a string value");
         filtered.add("setting [path.shared_data] is deprecated and will be removed in a future release");
-        if (JvmInfo.jvmInfo().getBundledJdk() == false) {
-            filtered.add("no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release");
-        }
         return filtered;
     }
 

+ 0 - 1
x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDocTests.java

@@ -353,7 +353,6 @@ public class ClusterStatsMonitoringDocTests extends BaseMonitoringDocTestCase<Cl
         when(mockJvmInfo.getVmName()).thenReturn("_jvm_vm_name");
         when(mockJvmInfo.getVmVersion()).thenReturn("_jvm_vm_version");
         when(mockJvmInfo.getVmVendor()).thenReturn("_jvm_vm_vendor");
-        when(mockJvmInfo.getBundledJdk()).thenReturn(true);
         when(mockJvmInfo.getUsingBundledJdk()).thenReturn(true);
 
         final Build mockBuild = new Build(Build.Flavor.DEFAULT, Build.Type.DOCKER, "", "", false, "");