commit | 05cadeb5915e490bcf7cae2f314cb8bd5388b7b6 | [log] [tgz] |
---|---|---|
author | Saša Živkov <sasa.zivkov@sap.com> | Fri Sep 08 12:48:49 2023 +0200 |
committer | Saša Živkov <sasa.zivkov@sap.com> | Fri Sep 08 13:19:59 2023 +0200 |
tree | 43024600814cc59a06275527bd82205e3809b450 | |
parent | abecc8e1951af2c1b334e05a439fd40450d8b4c3 [diff] |
Use a shared heartbeat thread pool, don't create one for each lock Before this change, each instance of the Lock class created a thread pool of size one to run the heartbeat task. This didn't scale well as the number of threads needed to maintain the heartbeat of N locks was N. There are Git operations which lock a large number of refs and this would have resulted in the large number of threads maintaining heartbeat for each lock. Now we use a dedicated thread pool of hardcoded size 10. We may make this size configurable in the future if we see a need for that. Change-Id: Ia657a7a7ab80c5124bba40981e79c281e7381f53
This plugin provides an implementation of the Gerrit global refdb backed by Cloud Spanner.
Requirements for using this plugin are:
A global refdb implementation is a requirement for a Gerrit multi-master scenario in a multi-site setup to ensure refs are updated consistently across multiple Gerrit primary sites.
Refer to the Gerrit multi-site plugin for more details on the high level architecture.
The in-memory Cloud Spanner emulator can be used during development. There are several limitations of the emulator that differ from the production service.
An easy way to run the emulator is to use gcloud CLI and Docker. Following the install instructions here will provide a local instance that the plugin can access. The gcloud CLI commands will be sent to the emulator instead of the production service. A test spanner instance and database will need to be created.
gcloud spanner instances create test-instance --config=emulator-config --description="Test Instance" --nodes=1 gcloud spanner databases create global-refdb --instance=test-instance
There are several limitations of the emulator which differ from the production service.
In order to easily set up and begin testing the spanner-refdb plugin, the multi-site plugin's local environment setup can be used.
This simulates a multi-site setup using two local gerrit instances. Build the release.war to include spanner-refdb and follow the linked example setup.
Configuration details can be found in the spanner-refdb config documentation.
When not used with the emulator, the plugin requires the path to credentials in the config to authenticate with google. To create the key see the official documentation.