commit | 011b10d3c8a5bc6a4e96f2f85e3322d4850f9ec5 | [log] [tgz] |
---|---|---|
author | Luca Milanesio <luca.milanesio@gmail.com> | Sat Mar 08 01:18:46 2025 +0000 |
committer | Álvaro Vilaplana García <alvaro.vilaplana@gmail.com> | Tue Mar 18 02:20:46 2025 -0700 |
tree | 4284d5e30ba71a97fadf950cad3ed5c88d37f0b6 | |
parent | 7a977b221e16adc5c5aa163d4150b6bf24a79985 [diff] |
Add sentinel to prevent out of sync with global-refdb Make sure the the global refdb is never updated to a value that is different from the local refdb. It may happen that a local operation has an undetected failure that causes the global-refdb to be updated to a non-existent value. By checking that the target SHA1 always corresponds to the local refdb value, any discrepancy would result in an error to the client and avoid to update the global refdb. This sentinel should never be needed in Gerrit, however it sometimes happens that the operation fails at Git level and the ref isn't updated as expected. Prevent nasty out of sync that would require a Gerrit admin to action and solve them one-by-one. Change-Id: If30079abd39f17f3859aa3f8b300b65cc0b7f117 (cherry picked from commit 669d5bad4c04ead5c800d999362fa9aced9888ec)
Global ref-database interface for use with Gerrit Code Review.
Enables the de-coupling between Gerrit, its libModules and the different implementations of a globally shared ref-database.
The design for a global ref-db interface can be found as part of the multi-site design documentation, where it first originated and was approved by the community.
In order to consume this library, some Guice bindings need to be registered appropriately. More information in the relevant documentation.
Global ref-database expose metrics to measure the global ref-database operation latency. List of the available metrics can be found here.
This libModule is built like a Gerrit in-tree plugin, using Bazelisk.
Create a symbolic link of the repository source to the Gerrit source tree /plugins/global-refdb directory.
Example:
git clone https://gerrit.googlesource.com/gerrit git clone https://gerrit.googlesource.com/modules/global-refdb cd gerrit/plugins ln -s ../../global-refdb . From the Gerrit source tree issue the command bazelsk build plugins/global-refdb
Example:
bazelisk build plugins/global-refdb
The libModule jar file is created under basel-bin/plugins/global-refdb/global-refdb.jar
To execute the tests run bazelisk test plugins/global-refdb/... from the Gerrit source tree.
Example:
bazelisk test plugins/global-refdb/...
Add global-refdb
in the CUSTOM_PLUGINS
section of the tools/bzl/plugins.bzl
.
Example:
CUSTOM_PLUGINS = [ "global-refdb", ]
Run tools/eclipse/project.py
for generating or updating the Eclipse project.