Page MenuHomePhabricator

Switch Gerrit from Java 11 to Java 17
Closed, ResolvedPublic

Description

Gerrit 3.10 it will drop support for Java 11 and require Java 17+:

https://www.gerritcodereview.com/3.10.html#dropped-support-for-java-11

Our servers run Bullseye with Java 11 and Java 17 is available https://packages.debian.org/search?keywords=openjdk-17-jdk&searchon=names&suite=all&section=all

A note by Matthias Sohn, upstream maintainer ( https://groups.google.com/g/repo-discuss/c/pSGsHbi2TEw/m/GMuXM8zIAAAJ ):

I think 3.8 should work on Java 17. AFAIK the first release fully supporting Java 17 was 3.6, see https://www.gerritcodereview.com/3.6.html.
Though 3.6 and 3.7 required this configuration on Java 17
https://issues.gerritcodereview.com/issues/40014855

This was fixed in 3.8.1 by https://gerrit-review.googlesource.com/c/gerrit/+/374575.

Event Timeline

gerrit1003 is on Bullseye, not Buster. And Bullseye also provides OpenJDK17 in parallel to 11, so you can switch to 17 without any OS change, but a simple Hiera change in profile::java

ACK, typo. It's bullseye and I wanted to say the same thing. It looks like we CAN do this without OS upgrade. Thanks for confirming that.

Paladox recommends we switch from 11 to 17 with the upgrade to Gerrit 3.9.

20:44 <paladox> 3.9 has a note for 17 but on 3.8 you can build for 17.

@hashar do you have specific plans on when you would like to upgrade to 3.9 and would you have a preferred order of executing the changes mentioned above?

I have filed a task to switch Jenkins to java 17 since they will require it on September 30th (T359795). So I guess we can tackle the migration of both in September. Gerrit 3.9 does default to Java 17 but still supports Java 11 so we can upgrade independently / ahead of time, I haven't looked at it yet, that is task T354887: Upgrade to Gerrit 3.9.

LSobanski triaged this task as Medium priority.May 13 2024, 3:38 PM
LSobanski moved this task from Incoming to Backlog on the collaboration-services board.
hashar renamed this task from gerrit 3.10 will require Java 17+ to Gerrit 3.10 will require Java 17.May 14 2024, 11:30 AM
hashar updated the task description. (Show Details)

I rewrote the task description to remove mention of upgrading Gerrit and the OS and have the task to focus solely on switching from Java 11 to Java 17.

hashar renamed this task from Gerrit 3.10 will require Java 17 to Switch Gerrit from Java 11 to Java 17.May 14 2024, 11:35 AM
hashar set Due Date to Apr 30 2025, 10:00 PM.May 14 2024, 11:56 AM

Change #1038249 had a related patch set uploaded (by Muehlenhoff; author: Muehlenhoff):

[operations/puppet@production] Switch gerrit2002 to Java 17

https://gerrit.wikimedia.org/r/1038249

Change #1038253 had a related patch set uploaded (by Hashar; author: Hashar):

[integration/config@master] dockerfiles: switch Gerrit to Java 17

https://gerrit.wikimedia.org/r/1038253

Change #1038253 merged by jenkins-bot:

[integration/config@master] dockerfiles: switch Gerrit to Java 17

https://gerrit.wikimedia.org/r/1038253

Change #1038258 had a related patch set uploaded (by Hashar; author: Hashar):

[integration/config@master] jjb: switch Gerrit jobs to Java 17

https://gerrit.wikimedia.org/r/1038258

Change #1038259 had a related patch set uploaded (by Hashar; author: Hashar):

[operations/software/gerrit@deploy/wmf/stable-3.8] Rebuild plugins for Java 17

https://gerrit.wikimedia.org/r/1038259

Change #1038258 merged by jenkins-bot:

[integration/config@master] jjb: switch Gerrit jobs to Java 17

https://gerrit.wikimedia.org/r/1038258

Change #1038260 had a related patch set uploaded (by Hashar; author: Hashar):

[operations/software/gerrit@wmf/stable-3.8] [WMF] rebuild plugins for Java 17

https://gerrit.wikimedia.org/r/1038260

Change #1038260 merged by jenkins-bot:

[operations/software/gerrit@wmf/stable-3.8] [WMF] change build to use Java 17

https://gerrit.wikimedia.org/r/1038260

It turns out that starting with Gerrit 3.9, upstream is providing a war file that requires Java 17. I found that out the hardware when attempting to upgrade from 3.8 to 3.9 earlier today ( T354887#9853725 ). According to https://groups.google.com/g/repo-discuss/c/pSGsHbi2TEw/m/JHj_QZcJAQAJ , support for Java 17 started with Gerrit 3.6, and 3.8.1 should fully support Java 17.

Thus I guess I will upgrade Java first (this task) and upgrade Gerrit to 3.9 after that (T354887).

Change #1038259 merged by jenkins-bot:

[operations/software/gerrit@deploy/wmf/stable-3.8] Rebuild plugins for Java 17

https://gerrit.wikimedia.org/r/1038259

Mentioned in SAL (#wikimedia-operations) [2024-06-03T14:53:07Z] <hashar@deploy1002> Started deploy [gerrit/gerrit@c93e47d]: Rebuild plugins for Java 17 - T364342

Mentioned in SAL (#wikimedia-operations) [2024-06-03T14:53:12Z] <hashar@deploy1002> Finished deploy [gerrit/gerrit@c93e47d]: Rebuild plugins for Java 17 - T364342 (duration: 00m 05s)

Mentioned in SAL (#wikimedia-operations) [2024-06-03T14:54:27Z] <hashar@deploy1002> Started deploy [gerrit/gerrit@6ba3f2e]: Rebuild plugins for Java 17 - T364342

Mentioned in SAL (#wikimedia-operations) [2024-06-03T14:54:35Z] <hashar@deploy1002> Finished deploy [gerrit/gerrit@6ba3f2e]: Rebuild plugins for Java 17 - T364342 (duration: 00m 08s)

Mentioned in SAL (#wikimedia-operations) [2024-06-03T14:57:06Z] <hashar@deploy1002> Started deploy [gerrit/gerrit@6ba3f2e]: Rebuild plugins for Java 17 - T364342

Mentioned in SAL (#wikimedia-operations) [2024-06-03T14:57:11Z] <hashar@deploy1002> Finished deploy [gerrit/gerrit@6ba3f2e]: Rebuild plugins for Java 17 - T364342 (duration: 00m 05s)

Mentioned in SAL (#wikimedia-operations) [2024-06-03T15:43:23Z] <hashar@deploy1002> Started deploy [gerrit/gerrit@c93e47d]: Revert "Rebuild plugins for Java 17" to stick to Java 11 based compiled plugins - T364342

Mentioned in SAL (#wikimedia-operations) [2024-06-03T15:43:28Z] <hashar@deploy1002> Finished deploy [gerrit/gerrit@c93e47d]: Revert "Rebuild plugins for Java 17" to stick to Java 11 based compiled plugins - T364342 (duration: 00m 05s)

Change #1038382 had a related patch set uploaded (by Dzahn; author: Dzahn):

[operations/puppet@production] gerrit: use Java 17 instead of Java 11

https://gerrit.wikimedia.org/r/1038382

Change #1038382 abandoned by Dzahn:

[operations/puppet@production] gerrit: use Java 17 instead of Java 11

Reason:

duplicate of https://gerrit.wikimedia.org/r/c/operations/puppet/+/1038249

https://gerrit.wikimedia.org/r/1038382

Change #1038249 merged by Muehlenhoff:

[operations/puppet@production] Switch Gerrit to Java 17

https://gerrit.wikimedia.org/r/1038249

Mentioned in SAL (#wikimedia-operations) [2024-06-04T07:46:57Z] <hashar@deploy1002> Started deploy [gerrit/gerrit@6ba3f2e]: gerrit2002: switch to Java 17 version of plugins after having switched Java to 17- T364342

Mentioned in SAL (#wikimedia-operations) [2024-06-04T07:47:02Z] <hashar@deploy1002> Finished deploy [gerrit/gerrit@6ba3f2e]: gerrit2002: switch to Java 17 version of plugins after having switched Java to 17- T364342 (duration: 00m 05s)

Mentioned in SAL (#wikimedia-operations) [2024-06-04T07:55:59Z] <hashar@deploy1002> Started deploy [gerrit/gerrit@6ba3f2e]: gerrit1003: switch to Java 17 version of plugins after having switched Java to 17- T364342

Mentioned in SAL (#wikimedia-operations) [2024-06-04T07:56:03Z] <hashar@deploy1002> Finished deploy [gerrit/gerrit@6ba3f2e]: gerrit1003: switch to Java 17 version of plugins after having switched Java to 17- T364342 (duration: 00m 03s)

Mentioned in SAL (#wikimedia-operations) [2024-06-04T07:56:29Z] <hashar> Restarting Gerrit for Java 17 upgrade # T364342

hashar claimed this task.

We have done the switch with @MoritzMuehlenhoff this morning. Both Gerrit instances are now running with Java 17 and the Gerrit plugins have been recompiled to use Java 17 as well.

Change #1039202 had a related patch set uploaded (by Hashar; author: Hashar):

[operations/software/gerrit@wmf/stable-3.9] Merge branch 'wmf/stable-3.8' into wmf/stable-3.9

https://gerrit.wikimedia.org/r/1039202

Change #1039202 abandoned by Hashar:

[operations/software/gerrit@wmf/stable-3.9] Merge branch 'wmf/stable-3.8' into wmf/stable-3.9

Reason:

https://gerrit.wikimedia.org/r/1039202