apache / druid

Apache Druid: a high performance real-time analytics database.
https://druid.apache.org/
Apache License 2.0
13.53k stars 3.71k forks source link

Javascript Strategies are Broken in Java 17 #17445

Open boaz-wiesner opened 3 weeks ago

boaz-wiesner commented 3 weeks ago

It seems that in Java 17 the javascript runtime is no longer built in. When a javascript strategy, such as the overlord affinity strategy, is evaluated at runtime, the strategy fails to run (and the task fails), saying that "engine" is null.

https://github.com/apache/druid/blob/5fcf4205e4b1f17edccc4a37cf338ed5e3047ae1/indexing-service/src/main/java/org/apache/druid/indexing/overlord/setup/JavaScriptWorkerSelectStrategy.java#L64

This may be expected behavior, and may be out of context for Druid to solve, however as Java 17 is the recommended runtime, there should probably be documentation on how to load the required libraries to allow Javascript functionality.

In the case that this is a distribution based issue, we're using openjdk-17-jre-headless.

Either way, for those looking for a quick workaround, like we were, reverting the overlord back to Java 8 works.