blob: d7f72aa4a3b5dd728c243ceaaf51102850bf3513 [file] [log] [blame] [view]
Hector Oswaldo Caballero28ed83b2018-08-06 07:40:18 -04001
Hector Oswaldo Caballero74a07ab2015-08-10 17:00:43 -04002@PLUGIN@ Configuration
3=========================
4
Matthias Sohnf707ea92019-05-02 23:21:32 +02005The @PLUGIN@ plugin must be installed as a library module in the
Luca Milanesio131888e2023-03-30 02:04:10 +01006`$GERRIT_SITE/lib` folder of all the instances and linked to
7`$GERRIT_SITE/plugins`, which enable to use it as both libModule
8and plugin.
9Configuration should be specified in the `$site_path/etc/@PLUGIN@.config` file.
Luca Milanesio716282b2018-02-19 15:18:36 -080010
Luca Milanesioe05bedb2019-02-22 10:20:29 +000011## Configuration parameters
Hector Oswaldo Caballero74a07ab2015-08-10 17:00:43 -040012
Luca Milanesio22ffb222018-02-21 10:28:30 -080013```cache.synchronize```
Luca Milanesio55076f62023-03-30 01:36:42 +010014: Whether to synchronize cache evictions. Set to false when relying on
15 low cache TTLs and therefore cache eviction is not strictly needed.
Luca Milanesio95039812024-04-16 15:28:51 +010016 It requires disabling the background cache evictions notifications in
17 `gerrit.config` by setting `cache.threads = 0`.
18
Owen Li66823002017-05-31 15:44:11 -040019 Defaults to true.
20
Luca Milanesio22ffb222018-02-21 10:28:30 -080021```cache.threadPoolSize```
Luca Milanesio6b6c5a82019-03-23 19:46:03 -070022: Maximum number of threads used to send cache evictions to the target
23 instance.
24
Hugo Arès02843f62018-04-20 08:57:25 +020025 Defaults to 4.
Hugo Arèsa897ed82017-05-31 11:47:03 -040026
Luca Milanesio22ffb222018-02-21 10:28:30 -080027```cache.pattern```
David Pursehouseaffefd92017-08-03 17:18:30 +020028: Pattern to match names of custom caches for which evictions should be
29 forwarded (in addition to the core caches that are always forwarded). May be
30 specified more than once to add multiple patterns.
Luca Milanesio6b6c5a82019-03-23 19:46:03 -070031
David Pursehouseaffefd92017-08-03 17:18:30 +020032 Defaults to an empty list, meaning only evictions of the core caches are
33 forwarded.
34
Luca Milanesio22ffb222018-02-21 10:28:30 -080035```event.synchronize```
Luca Milanesio55076f62023-03-30 01:36:42 +010036: Whether to synchronize stream events. Set to false when not using the SSH
37 stream events.
Owen Li66823002017-05-31 15:44:11 -040038 Defaults to true.
39
Luca Milanesiof51d7be2018-12-15 00:54:03 +000040```index.numStripedLocks```
Matthias Sohnf707ea92019-05-02 23:21:32 +020041: Number of striped locks to use during reindexing of secondary indexes.
Luca Milanesiof51d7be2018-12-15 00:54:03 +000042 Defaults to 10
43
Luca Milanesio22ffb222018-02-21 10:28:30 -080044```index.synchronize```
Luca Milanesio55076f62023-03-30 01:36:42 +010045: Whether to synchronize secondary indexes. Set to false when using multi-site
46 on Gerrit replicas that do not have an index, or when using an external
47 service such as ElasticSearch.
Owen Li66823002017-05-31 15:44:11 -040048 Defaults to true.
49
Alvaro Vilaplana Garcia5e335582023-12-18 14:49:05 +000050```index.synchronizeForced```
51: Whether to synchronize forced index events. E.g. on-line reindex
52automatically triggered upon version upgrades.
53Defaults to true.
54
Luca Milanesio22ffb222018-02-21 10:28:30 -080055```index.threadPoolSize```
Hector Oswaldo Caballero74a07ab2015-08-10 17:00:43 -040056: Maximum number of threads used to send index events to the target instance.
Hugo Arès02843f62018-04-20 08:57:25 +020057 Defaults to 4.
Hugo Arès7eeb21e2017-03-02 22:48:15 -050058
Luca Milanesio768a4ac2018-06-05 23:39:11 +010059```index.maxTries```
60: Maximum number of times the plugin should attempt to reindex changes.
Luca Milanesio6b6c5a82019-03-23 19:46:03 -070061 Setting this value to 0 will disable retries. After this number of failed
62 tries, an error is logged and the local index should be considered stale and
63 needs to be investigated and manually reindexed.
64
Luca Milanesio768a4ac2018-06-05 23:39:11 +010065 Defaults to 2.
66
67```index.retryInterval```
Matthias Sohnf707ea92019-05-02 23:21:32 +020068: The time interval in milliseconds between subsequent auto-retries.
Luca Milanesio768a4ac2018-06-05 23:39:11 +010069 Defaults to 30000 (30 seconds).
70
Marcin Czech6a0bc682019-11-23 15:26:26 +010071```broker.indexEventTopic```
72: Name of the topic to use for publishing indexing events
Luca Milanesio9cdf46a2019-02-16 00:56:01 +000073 Defaults to GERRIT.EVENT.INDEX
74
Marcin Czechabe9c4c2021-08-13 13:05:58 +020075`broker.streamEventTopic`
Antonio Baronefef8a612021-07-27 15:45:52 +020076: Name of the topic to use for publishing all stream events.
77 Default: gerrit
78
Marcin Czech6a0bc682019-11-23 15:26:26 +010079```broker.cacheEventTopic```
80: Name of the topic to use for publishing cache eviction events
David Ostrovskyd3baad62019-02-15 14:55:37 +010081 Defaults to GERRIT.EVENT.CACHE
82
Marcin Czech6a0bc682019-11-23 15:26:26 +010083```broker.projectListEventTopic```
84: Name of the topic to use for publishing cache eviction events
David Ostrovskyd3baad62019-02-15 14:55:37 +010085 Defaults to GERRIT.EVENT.PROJECT.LIST
David Ostrovsky4ee59472019-02-14 21:55:48 +010086
Marcin Czech757f0052021-08-26 15:30:55 +020087```broker.streamEventPublishTimeoutMs```
88: The timeout in milliseconds for publishing stream events.
89 Defaults to 30000 (30 seconds).
90
Luca Milanesio55076f62023-03-30 01:36:42 +010091**NOTE**: All broker settings are ignored when all of the `cache`,
92`index` or `event` synchronization is disabled.
93
Luca Milanesio54a643c2019-04-24 16:43:23 +010094```ref-database.enabled```
95: Enable the use of a shared ref-database
96 Defaults: true
97
Luca Milanesioae865552025-03-13 20:59:35 +000098```ref-database.pushReplicationFilterClassEnabled```
99: Enable the filtering of push replication events checking their
100 up-to-date status with the global-refdb.
101 Defaults: true
102
103```ref-database.pullReplicationFilterClassEnabled```
104: Enable the filtering of pull replication events checking their
105 up-to-date status with the global-refdb.
106 Defaults: true
107
Luca Milanesio79eb98d2025-01-30 09:05:07 +0000108```ref-database.replicationLagEnabled```
109: Enable the metrics to trace the auto-replication lag between sites
110 updating the `refs/multi-site/version/*` to the _epoch_ timestamp in
111 milliseconds. Please note that the `replication-lag` REST-API is also
112 disabled if this setting is false.
113 Defaults: true
114
Luca Milanesio2c3e0a22022-08-19 15:21:06 +0100115```ref-database.replicationLagRefreshInterval```
116: Enable the auto-refresh of the metrics to trace the auto-replication
117 lag by polling on a regular basis. Set to zero for disabling the polling
Luca Milanesio79eb98d2025-01-30 09:05:07 +0000118 mechanism. Disabled automatically when `ref-database.replicationLagEnable`
119 is set to false.
Luca Milanesio2c3e0a22022-08-19 15:21:06 +0100120 Defaults: 60 min
121
Tiago Palma251f2ec2019-04-30 18:46:08 +0100122```ref-database.enforcementRules.<policy>```
123: Level of consistency enforcement across sites on a project:refs basis.
Antonio Baroned13c2b72020-10-02 18:54:30 +0200124 Supports two values for enforcing the policy on multiple projects or refs.
Tiago Palma251f2ec2019-04-30 18:46:08 +0100125 If the project or ref is omitted, apply the policy to all projects or all refs.
126
127 The <policy> can be one of the following values:
128
129 1. REQUIRED - Throw an exception if a git ref-update is processed again
130 a local ref not yet in sync with the shared ref-database.
131 The user transaction is cancelled. The Gerrit GUI (or the Git client)
132 receives an HTTP 500 - Internal Server Error.
133
Antonio Baroned13c2b72020-10-02 18:54:30 +0200134 2. IGNORED - Ignore any validation against the shared ref-database.
Tiago Palma251f2ec2019-04-30 18:46:08 +0100135
136 *Example:*
137 ```
138 [ref-database "enforcementRules"]
Antonio Baroned13c2b72020-10-02 18:54:30 +0200139 IGNORED = AProject:/refs/heads/feature
Tiago Palma251f2ec2019-04-30 18:46:08 +0100140 ```
141
Antonio Baroned13c2b72020-10-02 18:54:30 +0200142 Ignore the alignment with the shared ref-database for AProject on refs/heads/feature.
Tiago Palma251f2ec2019-04-30 18:46:08 +0100143
Marcin Czechc7935512020-08-21 16:59:34 +0200144 Defaults: No rules = All projects are REQUIRED to be consistent on all refs.
145
146```projects.pattern```
147: Specifies which projects events should be send via broker. It can be provided more
148 than once, and supports three formats: regular expressions, wildcard matching, and single
149 project matching. All three formats match case-sensitive.
150
151 Values starting with a caret `^` are treated as regular
152 expressions. For the regular expressions details please follow
153 official [java documentation](https://docs.oracle.com/javase/tutorial/essential/regex/).
154
155 Please note that regular expressions could also be used
156 with inverse match.
157
158 Values that are not regular expressions and end in `*` are
159 treated as wildcard matches. Wildcards match projects whose
160 name agrees from the beginning until the trailing `*`. So
161 `foo/b*` would match the projects `foo/b`, `foo/bar`, and
162 `foo/baz`, but neither `foobar`, nor `bar/foo/baz`.
163
164 Values that are neither regular expressions nor wildcards are
165 treated as single project matches. So `foo/bar` matches only
166 the project `foo/bar`, but no other project.
167
168 By default, all projects are matched.
Luca Milanesio131888e2023-03-30 02:04:10 +0100169
Marcin Czech48520e72023-04-05 10:51:46 +0200170```replication.push-filter.minWaitBeforeReloadLocalVersionMs```
171: Specifies the minimum amount of time in milliseconds replication plugin filter will
172 wait before retrying check for ref which is not up to date with global-refdb.
173
174 By default: 1000 milliseconds
175
176```replication.push-filter.maxRandomWaitBeforeReloadLocalVersionMs```
177: Specifies the additional amount of time in milliseconds replication filter will
178 wait before retrying check for ref which is not up to date with global-refdb.
179
180 If maxRandomWaitBeforeReloadLocalVersionMs is set to zero random sleep for not in sync
181 refs is disabled.
182
183 By default: 1000 milliseconds
184
185```replication.fetch-filter.minWaitBeforeReloadLocalVersionMs```
186: Specifies the minimum amount of time in milliseconds pull-replication filter wait
187 before retrying check for ref which is not up to date with global-refdb.
188
189 By default: 1000 milliseconds
190
191```replication.fetch-filter.maxRandomWaitBeforeReloadLocalVersionMs```
192: Specifies the additional amount of time in milliseconds pull-replication filter will
193 wait before retrying check for ref which is not up to date with global-refdb.
194
195 If maxRandomWaitBeforeReloadLocalVersionMs is set to zero random sleep for not in sync
196 refs is disabled.
197
198 By default: 1000 milliseconds
199
Luca Milanesio131888e2023-03-30 02:04:10 +0100200## Replication filters
201
202The @PLUGIN@ plugin is also responsible for filtering out replication events that may
203risk to create a split-brain situation.
204It integrates the push and pull replication filtering extension points for validating
205the refs to be replicated and dropping some of them.
206
207**Replication plugin**
208
209When using the Gerrit core replication plugin, also known as push-replication, link the
210`replication.jar` to the `$GERRIT_SITE/lib` directory and add the following libModule
211to `gerrit.config`:
212
213```
214[gerrit]
215 installModule = com.googlesource.gerrit.plugins.replication.ReplicationExtensionPointModule
216```
217
218The above configuration would be automatically detected by the @PLUGIN@ plugin which would then
219install the PushReplicationFilterModule for filtering outgoing replication refs based
220on their global-refdb status:
221
222- Outgoing replication of refs that are NOT up-to-date with the global-refdb will be
223 discarded, because they may cause split-brain on the remote replication endpoints.
224
225- All other refs will be pushed as normal to the remote replication ends.
226
227**Pull-replication plugin**
228
229When using the [pull-replication](https://gerrit.googlesource.com/plugins/pull-replication)
230plugin, link the `pull-replication.jar` to the `$GERRIT_SITE/lib` directory and add the following
231two libModules to `gerrit.config`:
232
233```
234[gerrit]
235 installModule = com.googlesource.gerrit.plugins.replication.pull.ReplicationExtensionPointModule
236```
237
238The above configuration would be automatically detected by the @PLUGIN@ plugin which would then
239install the PullReplicationFilterModule for filtering incoming fetch replication refs based
240on their global-refdb status.
241
242- Incoming replication of refs that locally are already up-to-date with the global-refdb will be
243 discarded, because they would not add anything more to the current status of the local refs.
244
245- All other refs will be fetched as normal from the replication sources.