Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade minimum Java version to 21 #2798

Open
9 of 10 tasks
jarohen opened this issue Sep 26, 2023 · 6 comments
Open
9 of 10 tasks

Upgrade minimum Java version to 21 #2798

jarohen opened this issue Sep 26, 2023 · 6 comments

Comments

@jarohen
Copy link
Member

jarohen commented Sep 26, 2023

Once this is:

let's bump the minimum requirements for XT2 core.

  • Core package and server modules should have 21 as their minimum requirement - this is for us to (eventually) take advantage of Loom et al. Given that folks that don't want their applications to run on 21 can deploy XTDB separately and connect through the client, as well as the benefits it brings, I'm happy with imposing a high minimum standard here.
  • API and client modules should keep 11 as their minimum requirement, so that people who can't upgrade can still embed these in their application. We'll want to set these explicitly in the build files, obv, which will save us from compile-time incompatibilities, but we'd also benefit from tests which actually use Java 11 connecting to a Java 21 server.
    • Discuss: we could make 17 the minimum requirement here - anyone who can't use 17 can still use PgWire/HTTP, but this would mean us being able to use records/sealed interfaces etc in our XTQL AST
  • Anyone who can't upgrade to Java 11 can still use HTTP, but without our official client Clojure lib support.
@jarohen
Copy link
Member Author

jarohen commented Sep 26, 2023

Doesn't seem like Arrow supports Java 21 due to its use of Unsafe

1. Unhandled java.lang.UnsupportedOperationException
   sun.misc.Unsafe or java.nio.DirectByteBuffer.<init>(long, int) not available

           MemoryUtil.java:  174  org.apache.arrow.memory.util.MemoryUtil/directBuffer
             ArrowBuf.java:  229  org.apache.arrow.memory.ArrowBuf/getDirectBuffer
             ArrowBuf.java:  224  org.apache.arrow.memory.ArrowBuf/nioBuffer
         WriteChannel.java:  133  org.apache.arrow.vector.ipc.WriteChannel/write
    MessageSerializer.java:  303  org.apache.arrow.vector.ipc.message.MessageSerializer/writeBatchBuffers
    MessageSerializer.java:  276  org.apache.arrow.vector.ipc.message.MessageSerializer/serialize
          ArrowWriter.java:  147  org.apache.arrow.vector.ipc.ArrowWriter/writeRecordBatch
          ArrowWriter.java:  133  org.apache.arrow.vector.ipc.ArrowWriter/writeBatch
                  util.clj:  416  xtdb.util/build-arrow-ipc-byte-buffer/fn/fn/fn/write-batch!

@danepitkin
Copy link

Have you tried running with --add-opens=java.base/java.nio=ALL-UNNAMED? I believe this is a known issue. See https://arrow.apache.org/docs/java/install.html#java-compatibility

@jarohen
Copy link
Member Author

jarohen commented Sep 28, 2023

Hey @danepitkin, thanks for your comment 🙂

Yep, we're aware of that one, have got that in (and confirm we run into the known issue when it's removed). In our case, it works against Java 17 but not 21 - I think they changed the constructor of DirectByteBuffer in Java 21: https://issues.apache.org/jira/browse/SPARK-42369, which is depended on in MemoryUtil. Will write a note to this effect on the Arrow card 🙂

James

@jarohen
Copy link
Member Author

jarohen commented Sep 28, 2023

@danepitkin aha, fixed already in apache/arrow#35053 🙂

@danepitkin
Copy link

Ah, thanks for digging in to it! Sorry for the rabbit hole. The next Arrow release (v14) should be released in October, sometime after Oct 10th (code freeze).

jarohen added a commit to jarohen/xtdb that referenced this issue Oct 19, 2023
@jarohen
Copy link
Member Author

jarohen commented Nov 3, 2023

Cheers @danepitkin - can confirm this now works for us under the new Arrow 14 release 🙏

jarohen added a commit to jarohen/xtdb that referenced this issue Nov 9, 2023
jarohen added a commit to jarohen/xtdb that referenced this issue Nov 9, 2023
@jarohen jarohen removed the blocked label Jan 10, 2024
@jarohen jarohen removed the 2.x label Mar 22, 2024
jarohen added a commit to jarohen/xtdb that referenced this issue Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants