1169 Commits

Author SHA1 Message Date
Dave Borowitz
468d6c0e23 MigrateToNoteDb: Only reindex change index
Change-Id: Iafca90e9b1cebae4bf87da4fb75295f638227a96
2017-12-20 14:40:09 -05:00
David Pursehouse
85d4943935 Merge branch 'stable-2.14' into stable-2.15
* stable-2.14:
  Extend MigrateAccountPatchReviewDb summary with stats
  Print progress info from the MigrateAccountPatchReviewDb program

Change-Id: Ic3e1e4cb7f35b73b3e1564dc830ec2b1cf63b13e
2017-12-06 15:14:43 +09:00
Jacek Centkowski
b04decf8b5 Extend MigrateAccountPatchReviewDb summary with stats
Add the following information:
1. how many rows were migrated
2. how much time it took
3. what was migration speed (rows per/sec)

So that it is more consistent with Reindex operation output.

Change-Id: If49da15ed9806f2b0dd2e63911445a55785a5cfb
2017-12-05 14:01:59 +01:00
Saša Živkov
69678200e8 Print progress info from the MigrateAccountPatchReviewDb program
Change-Id: I54b26eebd530d7f5e6ac63c9570fcf5de1534ff1
2017-12-05 11:56:00 +01:00
David Pursehouse
03683239b1 Merge branch 'stable-2.14' into stable-2.15
* stable-2.14:
  config: sslCrl, use same case as documented

Change-Id: Ib41b3c238d34f0a19bba588d79e55bf06d337bdb
2017-11-23 19:09:00 +09:00
Sven Selberg
75615b4fa2 config: sslCrl, use same case as documented
According to documentation it is camelcase:
- Documentation/config-gerrit.txt

Change-Id: If9c7df14dd3f4439b64bed87e626528be8051d89
2017-11-22 08:32:20 +01:00
David Pursehouse
83f0a3c678 InitExperimental: Use com.google.inject instead of javax.inject
Change-Id: I1fc42967f7f6820d5c81fe6c8847c45fcc478b6c
2017-11-11 12:48:10 +09:00
Paladox none
dd2ae2d0c6 Upgrade Guava to 22.0
The dead lock issue is fixed: [1].

[1] https://github.com/google/guava/issues/2743

Bug: Issue 7645
Change-Id: I77dd930503e6869be207ca4a4f2fd85116719506
2017-11-02 19:10:14 +00:00
David Pursehouse
f510300d31 Merge branch 'stable-2.14' into stable-2.15
* stable-2.14:
  LogFileCompressor: Do not compress live logfile error_log.json

Change-Id: Ic83da7fda564b7ec74a8810e9e957531ef45fb86
2017-11-01 20:20:44 +09:00
Sven Selberg
954f3efb14 LogFileCompressor: Do not compress live logfile error_log.json
Change-Id: Ib402628c95c981e55e7339781030c05d25c4e831
2017-11-01 10:35:42 +01:00
Dave Borowitz
4ec8c675d9 Enable NoteDb for changes by default in new sites
NoteDb is no longer experimental in the sense that we are telling people
to migrate their production data. Give it an additional boost by making
it the default.

Change-Id: I4e6da109fccb7b93cbd7a773de1e8a96f145ff1f
2017-10-27 16:58:59 -04:00
Paladox none
fda694f9eb BaseInit: Use SchemaFactory for underlying ReviewDb
This fix is the same done in:
I871c6f32b1c7df7f5dbfb36fc2f229913759406f

Bug: Issue 7561
Change-Id: Iecc92e558adf8c950cd08b360ef681aba2369624
2017-10-25 21:38:39 +00:00
David Pursehouse
6d7c681f53 Merge branch 'stable-2.14' into stable-2.15
* stable-2.14:
  Fix typo in waitTimeout configuration and clarify its use
  Fix LogFileCompressor scheduling
  SshDaemon: introduce sshd.waitTimeout to set WAIT_FOR_SPACE_TIMEOUT

Change-Id: Ia205aae808e4041d818f3d397b112e81642b5388
2017-10-17 08:11:59 +09:00
Owen Li
0253aa223d Fix LogFileCompressor scheduling
Since: I1e665848cd7cd5f93628db97c0af17900d243f9d initial delay for the
scheduled task was not being calculated correctly, leading to the task
initially being run much later than expected.

Change-Id: I88dc9b10785b15f46eb21463a48e49d4416cd651
2017-10-16 11:29:05 -04:00
Orgad Shaneh
0bfa5d48e3 Revert from murmur3_128 to sha1 in LibraryDownloader
All the hashes are stored as sha1.

This was broken by ca5b7a548c09093f210b70675091e7dd641d37b2.

Change-Id: I6a86929509d7f2dc5b9bb0d1659293cf7770bb27
2017-10-15 10:45:55 +00:00
Orgad Shaneh
b42bbfd903 LibraryDownloader: Print exception on download failure
Change-Id: I25ecbf82deb9464e857969dc90d39a567ab8b70a
2017-10-15 12:33:54 +03:00
David Pursehouse
da2e265710 Merge "Revert "Update mysql-connector-java to 6.0.6"" into stable-2.15 2017-10-11 06:40:40 +00:00
Paladox none
7563a07837 Revert "Update mysql-connector-java to 6.0.6"
This reverts commit 0d839758febd82c1814ae815820e5f187a629497.

Updating to mysql-connector-java 6.0.6 broke the sql upgrader.

Bug: Issue 7331
Change-Id: I70b956452773d94ab42614aa8aff9b79ce40aba5
2017-10-11 06:37:47 +00:00
Dave Borowitz
8b3d600d55 Merge "InitAdminUser: Reindex admin group after adding the user" into stable-2.15 2017-10-09 13:30:10 +00:00
David Pursehouse
27133164f5 Merge "Merge branch 'stable-2.14' into stable-2.15" into stable-2.15 2017-10-05 23:09:37 +00:00
David Pursehouse
cf3d8d1a48 Merge branch 'stable-2.14' into stable-2.15
* stable-2.14:
  Increase the value of GERRIT_FDS parameter
  Fix invalid operator invalidating web session

Change-Id: Ifc9403f870f65f19e2f9d6c42a9754bbb07201bf
2017-10-05 21:52:49 +01:00
Edwin Kempin
b8b763781f InitAdminUser: Reindex admin group after adding the user
Since change Iff64365630 group members are now stored in the group
index. Hence after adding a group member the group must be reindexed.

Since the group reindex was skipped the membership of the initial admin
user in the Administrators group was not effective until a next reindex
of the group occurred.

Bug: Issue 7358
Change-Id: Idb5b91a92c682f03d74a5327ec96442f63999d14
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-10-05 18:06:43 +02:00
Edwin Kempin
dc4e5d339c Trigger GitRefUpdatedEvent when star labels are updated
When star labels are updated a refs/starred-changes/* branch in the
All-Users repository is updated. For this update we must trigger a
GitReferenceUpdated event, so that e.g. this ref update gets replicated
to Gerrit slaves.

For this GitRefUpdatedEvent we don't want to reindex the account since
star labels are not stored in the account index (but in the change
index and StarredChangesUtil already takes care to reindex the change).

Change-Id: I1d7fccfdeee603297e0b4e79393621b5ab57547a
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-10-05 16:52:00 +02:00
Edwin Kempin
54c04d380d Trigger GitReferenceUpdated event when account or change sequence is updated
This allows to replicate updates to the refs/sequences/* branches in
All-Users and All-Projects. Replicating these refs is not needed for
Gerrit slaves (since they do not create new accounts or changes) but
replicating these refs may be wanted if the replication target is a
Gerrit backup server.

Change-Id: Ib1d21a646d89b2e774dc9d50574eb990b8d79ece
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-10-05 16:07:54 +02:00
Edwin Kempin
02e281d9d3 Trigger GitReferenceUpdated event when external IDs are updated
When external IDs are updated the refs/meta/external-ids branch in the
All-Users repository is updated. For this update we must trigger a
GitReferenceUpdated event, so that e.g. this ref update gets replicated
to Gerrit slaves.

PostGpgKeys and GpgKeys are now injected as provider into
GpgApiAdapterImpl to avoid a circular Guice dependency:
GitReferenceUpdated needs EventUtil which needs ChangeJson.Factory.
ChangeJson uses GpgApiAdapter to find out if push certificates are
enabled and if yes to include the push certicates of the patch set
uploaders into RevisionInfo. This doesn't require PostGpgKeys and
GpgKeys. If PostGpgKeys would be injected without provider we would need
ExternalIdsUpdate.User to instantiate it which now needs
GitReferenceUpdated. Hence without injecting PostGpgKeys into
GpgApiAdapterImpl as a provider we would have a dependency circle.

Change-Id: Ia9c71d26669f24f20c659d82ae97ecfca6ab61c3
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-10-05 12:28:15 +02:00
Eryk Szymanski
2639d7cb27 Increase the value of GERRIT_FDS parameter
GERRIT_FDS is set to double of core.packedGitOpenFiles, which is
not sufficient to account for the file descriptors used by Git LFS.

If Git LFS plugin is enabled triple the value instead of doubling it.

Note the value of core.packedGitOpenFiles also relates to the
packedGitLimit, which is why it is not suggested to simply increase
the configured value.

Change-Id: Ibdf4d03f91611cdaf20f1e5ab7cffd83c1a62831
Signed-Off-By: Eryk Szymanski <eryksz@gmail.com>
2017-10-04 19:54:23 +02:00
Owen Li
e2877bb28d Create a scheduled task to automatically deactivate accounts
This job will perform scheduled sweeps of accounts registered in the
Gerrit to deactivate those which are reported as inactive by the auth
backend. This job is by default disabled. Currently, only the LDAP
implementation is covered.

Change-Id: I4ecdc08df477960f0e884d7e31e174ad6d47e6e0
2017-10-01 14:07:14 +01:00
Dave Borowitz
d1251e5512 Support trial mode in online NoteDb migration
As with auto-migration, this may be set either with a flag or a config
option. This means that NoteDbMigrator now has to modify multiple
"control" flags in the config that are not directly related to the
migration state.

Increase the heap size of the standalone tests, as it would otherwise
fail under bazel with "GC overhead limit exceeded". This implies there
is some kind of leak in the standalone sever test setup, but debugging
that is beyond the scope of this change.

Bug: Issue 7101
Change-Id: I36da7e49f5db7d095fde76e7d093e23125dffce3
2017-09-29 11:55:10 -04:00
David Pursehouse
f119e29e85 Merge branch 'stable-2.14'
* stable-2.14:
  Fix log compression

Change-Id: I40607c737355007c4e2bdf0c8f174cb08bed5e7c
2017-09-28 07:52:17 +02:00
Hugo Arès
9a28860560 Fix log compression
Any uncaught exception was silently causing subsequent executions to be
suppressed.

Catch and log any exceptions so root cause could be identified and
subsequent execution are not suppressed.

Change-Id: Ide998eb1edf583b483b3ce4f06c5b3a5dd1288d8
2017-09-27 08:58:29 -04:00
Paladox none
90ded88119 Update mariadb java connector to 2.1.2
Change-Id: Ifaf6ba82e5170b88349959d07247f32b918de439
2017-09-27 09:48:00 +00:00
Alice Kober-Sotzek
2776014d30 Perform group lookups by AccountGroup.Id from the group index
Now that we have the group index, we can use it to look up groups by
AccountGroup.Id. This change is a prerequisite for migrating groups to
NoteDb.

When migrating changes from ReviewDb to NoteDb, the author for the
NoteDb commit is looked up from the account cache. Account lookups
include accessing details about groups which are now retrieved from the
group index. For this reason, the site program MigrateToNoteDb needs to
set up the indices to be able to run successfully.

Change-Id: I86f85b6e418f3cad2dbfeacbf57c9375923221e6
2017-09-21 15:48:55 +02:00
Patrick Hiesel
6942c1ba48 Use injector and factory to instantiate SubmitRuleEvaluator
All callers of SubmitRuleEvaluator get AccountCache, Accounts and
Emails injected just to pass them to SubmitRuleEvaluator manually.

This commit adds a Factory to SubmitRuleEvaluator and migrates callers
to use the factory instead to remove boilerplate.

In addition, this commit moves the instantiation of ChangeControl from
the constructor closer to where it is needed to prevent the constructor
from throwing an OrmException.

Change-Id: I429e7a67e4f1a45be1cf2c2f05692661c086cabe
2017-09-19 16:59:32 +02:00
David Pursehouse
fe97782c35 Merge "Add accounts.visibility setting to ServerInfo" 2017-09-19 07:38:33 +00:00
Paladox
0d839758fe Update mysql-connector-java to 6.0.6
mysql-connector-java 6.x discontinues support for mysql versions anything
lower than 5.5, and it also adds support for Java 8.

Bug: Issue 6229
Change-Id: I73bf0fae98a1a845fd903bc056f89a716ecd521
2017-09-12 19:38:02 +00:00
Paladox
c2f76b8e27 Merge branch 'stable-2.14'
* stable-2.14:
  Fix rendering in documentation of LocalUsernamesToLowerCase
  Consistently use toLowerCase() in ConsoleUI.readEnum

Change-Id: I38bbf228fb6a7a3a1962f54f98474d23739acc02
2017-09-07 15:53:12 +01:00
Saša Živkov
b9e002444b Consistently use toLowerCase() in ConsoleUI.readEnum
The list of supported options was converting enum names to lower case
but the input prompt didn't do the same for the default value.

Change-Id: I9d300572dea830480362e92c91a8eae679d2f954
2017-09-07 12:08:39 +00:00
Edwin Kempin
f0dacbd1d0 Add accounts.visibility setting to ServerInfo
This information may be used to answer support requests about why an
account is not found by the reviewer suggestion.

Change-Id: I0e88e05ca218dcd52028743c352ae6e4d6945ded
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-08-31 11:43:33 +02:00
Dave Borowitz
00ed781030 MigrateToNoteDb: Fix GitRefUpdated binding
ReindexAfterRefUpdate is not what we want at all; reindexing is handled
specially at the end of the process. This was probably a copy/paste
error.

Do bind GitRefUpdated to DISABLED, which may be what was intended here,
and even if not, is likely a good idea anyway.

Change-Id: I7785d02a6c5aa44fd4baa3f616044580ffff9a56
2017-08-29 18:03:04 -04:00
Edwin Kempin
6957747c87 Remove support for writing accounts from ReviewDb
Accounts have been fully migrated to NoteDb. However inside of Google we
still have code that depends on the Accounts table. hence this table is
dropped only later by a follow-up change.

Change-Id: Ia32983e2877e3965561db7d264cf1d2b7b2e40c3
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-08-29 14:49:00 +02:00
Edwin Kempin
916112ed91 AccountIndex: Add fields that allow to detect an account document as stale
To be able to tell whether an account is stale in the index we need to
record a state ID for each source that contributes to the account
document (user branch + external IDs). For the user branch we can record
its ref state (similar to how the change index records ref states / ref
state patterns for all refs that contribute to a change). For the
external IDs branch the ref state is not sufficient because it changes
whenever any external ID is updated and we don't want to detect all
accounts as stale after each external ID update. Hence for the external
IDs we record the IDs of the note blobs instead.

Change-Id: I7f0383cb46e461cc5158bf13f31d608a927bfd49
Signed-off-by: Edwin Kempin <ekempin@google.com>
2017-08-24 16:07:44 +02:00
David Pursehouse
b27ccf6095 Merge "Merge branch 'stable-2.14'" 2017-08-23 03:29:29 +00:00
David Pursehouse
45f5b1e3c2 Merge "Update MySQL connector to 5.1.43" 2017-08-23 01:54:02 +00:00
David Pursehouse
5a3a4dc9a7 Merge changes Ideaead9b,I53e5d9a9
* changes:
  Store metaId in account
  ExternalId: Store the ID of the note blob on read
2017-08-23 00:32:01 +00:00
Paladox
e6d30053e6 Merge branch 'stable-2.14'
* stable-2.14:
  JdbcAccountPatchReviewStore: Add configurable settings to datasource

Change-Id: Ibf5e2e406c75b9f58c5a02273932bee2e21e0917
2017-08-23 00:41:59 +01:00
Paladox none
680e3eb3f0 Update MySQL connector to 5.1.43
Includes a fix for mysql 8.x to work.

See changes at
https://github.com/mysql/mysql-connector-j/blob/5.1.43/CHANGES#L4

Change-Id: I22ca3ade3e315ef06ec8c092473a8988752ede2d
2017-08-21 21:41:32 +00:00
Paladox none
0d5a4f3664 Update MariaDB to 2.1.0
* https://github.com/MariaDB/mariadb-connector-j/releases/tag/2.1.0

* https://github.com/MariaDB/mariadb-connector-j/releases/tag/2.0.3

Change-Id: I5c502c8687b8018bb3af73b526fbd13111c9ac23
2017-08-21 21:41:28 +00:00
Hector Oswaldo Caballero
8dead9663f JdbcAccountPatchReviewStore: Add configurable settings to datasource
So far, the datasource used to connect to the AccountPatchReviewStore
was using hard coded values for the pool connection settings. In high
traffic servers, those default values cause a bottleneck as the
transactions start to be queued when the max number of connections is
reached.

Add the possibility of specifying those values in the gerrit
configuration so they can be tailored to diverse needs.

Change-Id: I7d0cd1e2fe02cea3c5f78ef90398e9ac670a9a93
2017-08-20 06:13:08 -04:00
David Pursehouse
c1b9c9e743 Merge branch 'stable-2.14'
* stable-2.14:
  Don't crash on empty diff selection
  H2AccountPatchReviewStore: Factor out test store
  JdbcAccountPatchReviewStore: Simplify module

Change-Id: Ic02d6bea5109cc2eb070808732e44232a93987cc
2017-08-18 22:38:29 +01:00
Hector Oswaldo Caballero
260c66d9ab H2AccountPatchReviewStore: Factor out test store
Change-Id: I5d35e965dd09aeea8c8684266b0be00a84424ab8
2017-08-18 11:22:33 -04:00