Support Jdbc implementation of AccountPatchReviewStore
Provide in gerrit core support for alternative database backends
for AccountPatchReview store.
H2 was used for storing AccountPatchReview. This can become
problematic in large installation since embedded H2 cannot execute
concurrent requests even to the same database. The options related to
multi-thread in H2 are:
- MULTI_THREADED: a long running query blocks the ones in other
threads [1].
- MVCC: This is not production-ready yet, since it is not fully
tested [2].
AccountPatchReviewStore is an extension and a plugin could
implement a jdbc store but this would result in duplicated code
with core H2 implementation. Since core H2 implementation was
almost already compliant to jdbc standard, it's easy to make
jdbc url configurable in gerrit config and make the core support
other database than H2.
One could extend the H2 implementation in plugin, however the
changes on the supper class could lead to breaking plugin
implementation.
[1] http://www.h2database.com/html/features.html#multiple_connections
[2] http://www.h2database.com/html/advanced.html#mvcc
Change-Id: Ie61ac63a72cab71bd907886a794541cb3dea291e
diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt
index d796fa4..0a28534 100644
--- a/Documentation/config-gerrit.txt
+++ b/Documentation/config-gerrit.txt
@@ -19,6 +19,26 @@
directory = /var/cache/gerrit2
----
+[[accountPatchReviewDb]]
+=== Section accountPatchReviewDb
+
+[[accountPatchReviewDb.url]]accountPatchReviewDb.url::
++
+The url of accountPatchReviewDb. Supported types are `H2`, `POSTGRESQL`, and
+`MYSQL`. Drop the driver jar in the lib folder of the site path if the Jdbc
+driver of the corresponding Database is not yet in the class path.
++
+Default is to create H2 database in the db folder of the site path.
++
+Changing this parameter requires to migrate database using the
+link:pgm-MigrateAccountPatchReviewDb.html[MigrateAccountPatchReviewDb program]
+before restarting the Gerrit server.
+
+----
+[accountPatchReviewDb]
+ url = jdbc:postgresql://<host>:<port>/<db_name>?user=<user>&password=<password>
+----
+
[[accounts]]
=== Section accounts