commit | ebe85a57e43543b06e0cec2b89037e6ae9ddb0a8 | [log] [tgz] |
---|---|---|
author | Antonio Barone <syntonyze@gmail.com> | Mon Mar 03 17:36:52 2025 +0100 |
committer | Antonio Barone <syntonyze@gmail.com> | Wed Mar 05 12:30:01 2025 +0100 |
tree | 9ce2a216b9f3ef0fc77aabfb8c940046334c77a2 | |
parent | d4e2513dd77c5ccc246d36ce8e0f8afb4c7b40ee [diff] |
Introduce global_refdb/operation_failures counter When an operation against the global ref-db fails, an exception is thrown and propagated to the caller, who decides whether to retry or give up. Previously, failure-related metrics might have been only emitted indirectly by the caller (e.g., 503 LOCK_FAILURE, retry count, etc.), meaning there was no dedicated metric to track failures at the global ref-db level. This made it difficult to monitor and analyze failures independently of the implementation details. This change introduces a cumulative counter, global_refdb/operation_failures, which increments on every failure. This allows failures to be monitored directly from the global ref-db, regardless of the specific implementation or how the caller handles the exception. Bug: Issue 400338979 Change-Id: I0bf752bc2f7a7b9bdb0f2b3eed6b7fdd623a7e14
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 bazelisk build plugins/global-refdb
Example:
bazelisk build plugins/global-refdb
The libModule jar file is created under bazel-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.