Development/Upgrading MB Solr dependencies

From MusicBrainz Wiki
< Development
Revision as of 07:51, 8 January 2024 by YvanZo (talk | contribs) (Create a central page for upgrading MB Solr dependencies as it takes 3/4 repositories and many more parameters to be tried together)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Upgrading MB Solr dependencies

Goal

Ultimately, we want to upgrade our Solr version from 7.7.2 (which is EOL for a long time already) to 9.x.

That requires to upgrade the JDK version from 8 to 11 at least, or even 17 if possible. Those are all LTS versions.

Upgrading the JDK version can be or not be done independently as a first step, as long as it works.

About JAXB

JAXB (Architecture for XML Binding) 2 is used by both mmd-schema and mb-solr.

Its specification is part of Jakarta EE which is part of EE4J (Eclipse Enterprise for Java) and is the new name for the former Java EE platform. It is basically the same thing transfered by Oracle to the Eclipse Foundation in 2017: The new API namespace is jakarta (instead of javax which is a trademark owned by Oracle). At the same time, Java EE has been removed from the JDK. It was provided in JDK 8, it is no longer provided in JDK 11. Most of our issues have been due to this change in the JDK.

The open source implementation of Jakarta EE (formerly Java EE) is named GlassFish and is also part of EE4J nowadays.

  • Jakarta EE 9.1 supports JDK 11 (and JDK 8)
  • Jakarta EE 10 supports JDK 17 (and JDK 11)

Relatedly, JAXB Maven Plugin is used by mmd-schema to integrate the Maven build system.

Last, the pull request mb-solr#49 has been trying to address the issue of loading JAXB implementation, even though it was partly based on obsolete information, it has the merit of looking into pre-existing issues.

About this page

We had a Solr 9 instance running on JDK 17 during Summit 22, but we haven’t been able to make it work again since then. Many things are being updated at the same time, some depending on the others, so it is easy to get lost on the way. That’s why this page exists: Keep track of what is being tried to discard dead ends and to find a solution in the end.

Issues can be found at mb-solr build time (in build logs), and at run time (in server logs) using musicbrainz-docker.

From Development/Search Architecture, our repository mb-solr internally depends on our repositories mbsssss and mmd-schema. Since the two last repositories are git submodules of the first repository, we identify below each combination of these three repositories just by the git reference to mb-solr. Many other tries have been done in the meantime; See git log.

Current v3.4.2

mb-solr v3.4.2

Dependencies
group artifact version scope
org.glassfish.jaxb jaxb-runtime 2.3.0 /
Build plugins
group artifact version configuration
org.apache.maven.plugins maven-compiler-plugin 3.3 source/target: 1.8
  • Compile image: maven:3.6.1-jdk8
  • Runtime image: metabrainz/solr:7.2.2-alpine (based on adoptopenjdk/openjdk8:alpine-jre)

mbsssss v-2021-05-14

  • luceneMatchVersion: 7.7.2

mmd-schema v-2020-11-12

Dependencies
group artifact version scope
com.sun.xml.bind jaxb-impl 2.3.0.1 compile
Build plugins
group artifact version configuration
org.apache.maven.plugins maven-compiler-plugin 3.7.0 source/target: 1.8
org.jvnet.jaxb2.maven2 maven-jaxb2-plugin 0.14.0 /

Try 15507c0

Attempt to move to JDK 11 with minimum changes. (Some variations have been tried too; See git log.)

mb-solr 15507c0

Pull request #38; Branch amCap1712:SEARCH-625; Commit 15507c0

Dependencies
group artifact version scope
com.sun.xml.bind jaxb-impl 2.3.3 runtime
jakarta.xml.bind jakarta.xml.bind-api 2.3.3 /
Build plugins
group artifact version configuration
org.apache.maven.plugins maven-compiler-plugin 3.8.1 release: 11
  • Compile image: maven:3.6.1-jdk8
  • Runtime image: metabrainz/solr:7.2.2-alpine (based on adoptopenjdk/openjdk8:alpine-jre)

mbsssss v-2021-05-14

  • luceneMatchVersion: 7.7.2

mmd-schema 3a35da3

Pull request #30; Branch java11; Commit 3a35da3

Dependencies
group artifact version scope
com.sun.xml.bind jaxb-impl 2.3.3 compile
jakarta.xml.bind jakarta.xml.bind-api 2.3.3 /
Build plugins
group artifact version configuration
org.apache.maven.plugins maven-compiler-plugin 3.8.1 release: 11
org.jvnet.jaxb2.maven2 maven-jaxb2-plugin 0.15.1 /

Try b44c79b

Attempt to move to Solr 9.0.0 and JDK 17. (Some variations have been tried too; See git log.)

mb-solr b44c79b

Pull request #48; Branch solr9; Commit b44c79b

Dependencies
group artifact version scope
jakarta.xml.bind jakarta.xml.bind-api 3.0.1 /
javax.activation activation 1.1.1 /
org.glassfish.jaxb jaxb-runtime 3.0.2 /
Build plugins
group artifact version configuration
org.apache.maven.plugins maven-compiler-plugin 3.8.1 release: 11
  • Compile image: maven:3.8.6-eclipse-temurin-17-focal
  • Runtime image: broken, should have been solr:9.0.0 (based on eclipse-temurin:17-jre-focal too)

mbsssss f4efa44

Pull request #63; Branch solr9; Commit f4efa44

  • luceneMatchVersion: 9.0.0
    (and minor changes for compatibility)

mmd-schema 3a35da3

Pull request #30; Branch java11; Commit 3a35da3

Dependencies
group artifact version scope
com.sun.xml.bind jaxb-impl 2.3.3 compile
jakarta.xml.bind jakarta.xml.bind-api 2.3.3 /
Build plugins
group artifact version configuration
org.apache.maven.plugins maven-compiler-plugin 3.8.1 release: 11
org.jvnet.jaxb2.maven2 maven-jaxb2-plugin 0.15.1 /