title: “Gerrit 3.2.0 Release” permalink: 3.2.html hide_sidebar: true hide_navtoggle: true toc: true

Release Highlights

  • Polymer 3

  • File Uploads in frontend

  • Performance improvements on mergeability check and accounts caching

  • Support for Java 11

Important Notes

Support for Java 11

Gerrit is now officially supported on Java 11, in addition to Java 8. Running on Java 11 was already possible from v2.16.13, v3.0.4 and v3.1.0, but not officially supported because of the lack of a CI validation on Java 11 for stable-2.16, stable-3.0 and stable-3.1 branches.

Please note that Java 11 has a number of improvements and breaking changes compared to Java 8. Refer to the Java 11 release notes for more details.

Gerrit v3.2 has been validated with Java 11, with the following known issues:

  • Issue 11567: Java 11 runtime & startTLS LDAP broken: ‘error code 8 - BindSimple: Transport encryption’.

  • Issue 12639: WARNING: An illegal reflective access operation has occurred, when starting Gerrit.

Schema Changes

This release contains schema changes. To upgrade:

  java -jar gerrit.war init -d site_path

The changes index version has been increased. To run off-line reindexing of the changes (optional):

  java -jar gerrit.war reindex --index-name changes -d site_path

By default the changes index is automatically rebuilt upon the Gerrit startup after the upgrade.

PERFORMANCE WARNING: The migration process performs the cleanup of the zombie draft comments in the All-Users.git repository that have been left behind since the introduction of NoteDb. It is highly recommended to perform a git gc --aggressive of the All-Users.git repository BEFORE running the migration. Also the reindex of all the changes can take a significant amount of time for large-scale installations.

Also, make sure that the All-Users.git resides on a fast access local filesystem for minimizing the migration time.

Zero-downtime Upgrade

Gerrit supports zero-downtime upgrade from Gerrit v3.1.6 (or later) when configured using a high-availability configuration, when the Git repositories are stored in a shared filesystem such as NFS or similar.

For upgrading with zero-downtime, you should enable the rolling upgrade migration in gerrit.config on both Gerrit masters by setting the gerrit.experimentalRollingUpgrade to true.

During the zero-downtime upgrade, Gerrit end-users would not notice any outage or service disruption. They will be able to perform the normal Gerrit operations on the GUI or using the Git protocol.

The zero-downtime upgrade consists of the following steps:

  1. Have Gerrit masters upgraded to v3.1.6 (or later) in high-availability configuration, healthy and able to handle the incoming traffic properly.
  2. Set gerrit.experimentalRollingUpgrade to true in gerrit.config on both Gerrit masters.
  3. Set the first Gerrit master unhealthy.
  4. Shutdown the first Gerrit master and then upgrade to v3.2.
  5. Startup the first Gerrit master and wait for the on-line reindex to complete.
  6. Verify that the first Gerrit master is working properly and then make it healthy again.
  7. Wait for the first Gerrit master to start serving traffic normally.
  8. Repeat steps 3. to 7. for the second Gerrit master.
  9. Remove gerrit.experimentalRollingUpgrade from gerrit.config on both Gerrit masters.

NOTE: During the zero-downtime upgrade, the nodes may experience an increase of CPU and memory utilisation due to the online reindexing activity. If testing reveals that the nodes are not able to keep sustained load in conjunction with the online reindexing, then you have to follow the standard migration path.

Breaking Changes

  • Issue 12527: Elasticsearch: Support for EOL versions v5.6 and v6.0 to v6.5 is discontinued

  • Issue 12858: ListGroups: the --query2 option in the groups query REST-API has been renamed to --query

New Features

Mergeability behavior and performance

This release introduces a configuration setting change.mergeabilityComputationBehavior that defines when Gerrit computes the mergability of a change .

Computing the mergability of changes is an expensive operation that can be become a bottleneck for large Gerrit installations. The new setting allows administrators to control this expense. Please refer to the Gerrit documentation for more details about this setting.

New accounts cache

Introduction of a brand-new AccountCache decomposed into smaller chunks that can be cached individually:

  • External IDs + user name (cached in ExternalIdCache)
  • CachedAccountDetails (newly cached)
  • Gerrit’s default settings CachedAccountDetails – a new class representing all information stored under the user’s ref (refs/users/<sharded-id>)

The new structure is cleverly designed to require a lot less I/O when an entry needs to be reloaded and lowering the ratio of cache-miss in case of user’s details updates.

File Uploads

File Uploads are now supported in the User Interface or through the REST API.

New Revert permission

Introduce a new permission to allow/deny the ability to revert a change through the Gerrit UI.

The permission is automatically added to the Registered Users as part of the schema upgrade. To deny reverts, Gerrit administrators should remove this permission from All-Projects ACL.

New is:merge merge operator for searching changes

Introduce the new is:merge operator for allowing to find changes that are merge commits. This change requires a full reindex of the changes, which may take quite a long time to compute for large-sized installations.

When choosing the on-line reindexing option (default) Gerrit can still operate with the old index version, disabling the is:merge operator until the new index has been successfully rebuilt.

PolyGerrit UI

The Gerrit frontend has been migrated from Polymer 2 to Polymer 3.

  • Users can now cherry pick entire topics.

  • Gerrit supports adding display names. Hosts can configure first name or username as default.

  • The reply dialog now shows the entire comment thread instead of the comment list.

  • Issue 6293: More self-evident transitions from WIP state. “Start Review” button added to change view.

  • Issue 8153: Improvements to rebase indicator: display a hover card instead of a tooltip with the icon including the possible rebase action.

  • Issue 10444: UI for deleting change messages for Gerrit Administrators.

  • Issue 10890: Repository list: Move “Repository Browser” column left of “Description” column.

  • Issue 11441: Add in-product reminder to keep discussions respectful.

    Some code review discussions can become a bit rough and some people perceived discussions as not always respectful. Add an in-product reminder to keep discussions respectful when a reply is typed, optionally with linking to the code of conduct.

  • Issue 11493: Add an “Edit” button to the diff view in the PolyGerrit UI.

  • Issue 11521: Display trace ID in error popup if request failed and server did a trace.

  • Issue 11522: REST API for review labels in the project configuration.

  • Issue 11705: Show count of changes in User Dashboard.

  • Issue 11706: Allow editing the commit message as part of a change edit.

  • Issue 11973: Add copy-to-clipboard for generated HTTP password.

  • Issue 12364: Add support for going to a specific line number in the inline editor.

Download commands plugin

  • Issue 11594 Merge the repo-vs-git logic into GitDownloadCommand directly.

    Created separate “getRepoCommand” and “getCommand” methods for downstream classes to extend with the default “getRepoCommand” defaulting to null.

  • Issue 11609 “Download patch” UI includes an option for also creating a local branch.

    A very standard workflow is to download a change from Gerrit then want to make edits and then repo upload the changes back to Gerrit. Allow developers who are not familiar with the idiosyncrasies of repo, to easily create a local branch when checking out changes.

End-to-end tests

  • Allow end-to-end tests to proportionally scale on their expected execution times.

    A power_factor environment property was added to the end-to-end tests core framework. Using that optional property, scenario steps can take some more (or less) time prior to expecting proper completion.

    The way to set that property locally then depends on the target runtime environment, or SUT latency. The property may be used for either core or plugin scenarios.

  • FlushProjectsCache related scenarios added to core (and the high-availability plugin).

  • Support for relative runtime weights in scenarios.

    Each scenario can now either weight like any other by default, or override that default with a greater weight value, compared to siblings that are lighter on execution times.

    Beside core, make the high-availability and multi-site plugin scenarios reuse this.

  • Allow scenarios to create and delete Gerrit changes alongside projects.

    Add the corresponding core support for an optional http request body to every such GerritSimulation. Either automate or allow environment properties to feed the related input test data.

    Beside core, make the high-availability and multi-site plugin scenarios test changes that way. The latter currently has Issue 12693 as a known limitation.

Bug Fixes

  • Replication plugin fixes

    • Issue 11672: Change the storage structure of the persisted replication tasks to avoid losing events.

    • Issue 11745: Fix firing pending “..all..” events on startup.

    • Issue 11760: Make persistent task keys stable.

    • Issue 12678: Fix missing replication Id in replication logs.

    • Issue 12719: Fix replication start --wait to track in-flight collisions and to not fail.

    • Issue 12731: Don‘t lose state when there’s a pending push to the same ref.

  • PolyGerrit fixes

    • Issue 4616: Open commentlinks to changes on the same server in the same tab.

    • Issue 7083: Stop query from executing if predicate is empty.

    • Issue 8068: Fix screenreader: In unified mode, stop showing “0 added/removed”.

    • Issue 9296: Fix wrong diff of commit message between different patch sets of a merge commit.

    • Issue 11515: Fix Ctrl-Enter on Move Change

    • Issue 11552: Fix prev/next on diff screen with unchanged files containing only comments.

    • Issue 11625: Avoid multiple notifications for existing reviewers.

    • Issue 11697: Fix rendering of commentlinks without leading whitespace.

    • Issue 11725: Fix diff view file name shown even when the file wasn't changed, but only included because contains a comment.

    • Issue 11727: Fix blue underline missing from active tabs.

    • Issue 11782: Fix assignment of CSS style for CodeReview -1 labels within comments.

    • Issue 11969: Fix tab index in reply dialog.

    • Issue 11980: Fix handling of LDAP groups containing a dot in the PolyGerrit permissions screen.

    • Issue 11984: Fix top menu bar on iOS.

    • Issue 11993: Stop loading fonts from external resources.

    • Issue 12020: Fix ‘New Contributor Agreement’ screen.

    • Issue 12024: Fix undefined branch in create-destination-dialog.

    • Issue 12031: Fix issues with caching edited commit message.

    • Issue 12067: Fix blank screen after upgrading.

    • Issue 12108: Add missing ‘Page ...’ on pagination links in the repository list.

    • Issue 12184: Fix link in blame annotation to link directly to the commit.

    • Issue 12197: Fix rendering of commentlinks using link in PolyGerrit UI.

    • Issue 12224: Honor the date format preference when displaying dates.

    • Issue 12385: Fix memory leak in gr-plugin-endpoints.

    • Issue 12707: Apply diff preferences immediately after pressing “Save”.

    • Issue 12726: Fix incorrect highlighting after / character in Javascript.

    • Issue 12775: Fix parent of previous patch sets not being available.

  • Other fixes

    • Issue 3340: Fix internal server errors when setting project access permission with bad regex.

    • Issue 7645: Fix thread deadlock when loading accounts from the account cache.

      Replacing Guava caches with Caffeine reduces the chances of having the deadlocks and improves the cache performance.

    • Issue 7969: Fix internal server error when diffing MERGE_LIST between different patch sets of a merge commit.

    • Issue 8952: Do not require explicit “Push Tag” rights to refs/tags/* for pushing an annotated tag over HTTPS.

    • Issue 10397: Don't send notification email when publishing a change edit on a WIP change.

    • Issue 11650: Fix reindexing of changes after project is deleted in the delete-project plugin.

    • Issue 11962: Fix advertisement of refs/meta/config in git protocol v2 when client does not have access to it.

    • Issue 11986: Fix fetching individual ref with git protocol v2.

    • Issue 11989: Fix internal server error when pushing over SSH with git protocol v2.

    • Issue 12070: Fix internal server error on git over HTTP calls when SSHD is enabled.

    • Issue 12243: Fix unexpected deactivation of service user accounts.

    • Issue 12246: Fix generation of duplicate ChangeIds when creating a new change via REST.

    • Issue 12440: Fix the access-path for AbstractGitCommand subclasses.

    • Issue 12444: Add support for max_result_window in Elasticsearch index configuration.

    • Issue 12473: Fix broken links in Elasticsearch configuration documentation.

    • Issue 12606: Fix visibleto predicate for groups.

    • Issue 12747: Fix change query visibility for internal user.

    • Issue 12755: Block the removal of the Realm primary external ids.

Dependency Updates

  • Upgrade flogger to 0.5.1

  • Upgrade guava to 29.0

  • Upgrade guice to 4.2.3

  • Upgrade jgit to 5.8.0.202005061305-m2

  • Upgrade mina-sshd to 2.4.0

  • Upgrade ow2 to 7.2

  • Upgrade truth to 1.0.1

Native packaging

  • Upgrade the Docker/Ubuntu image to Ubuntu 20.04

  • Upgrade the Docker/CentOS image to CentOS 8.1.1911

  • Move to OpenJDK 11

    Gerrit v3.2 supports both Java 8 and 11. However, Java 11 is the best choice for large production servers thanks to the introduction of more advanced Garbage Collection strategies and associated tuning for large heaps.

Bugfix Releases

3.2.1 (In development)

  • New Features

  • PolyGerrit UI Fixes

  • Other Fixes