Revert "Create index on fresh install"

This reverts commit 5c44d09dc7.

This change forced us to do an offline reindex whenever the war was
updated. Unfortunately, that means even on minor upgrades we do a long
reindex, which times out in puppet, then puppet fails as does an
upgrade.

You can address this by setting offline_reindex = true when doing a new
install, then flip that to false (the default) once the new install is
bootstrapped.

Change-Id: I1f730a1cd2bcf96e6b94f2d0a82078f46d49e0ce
This commit is contained in:
Clark Boylan 2019-01-14 09:21:55 -08:00
parent 8cfffc49bc
commit 0abb2f5716
2 changed files with 6 additions and 15 deletions

View File

@ -142,6 +142,10 @@
# removed.
# offline_reindex:
# Set this to true to run an offline index on upgrade
# Note the default is false, but you need to set this to true if
# bootstrapping a new install of gerrit. On a new install of Gerrit we
# need to init the indexes. When doing upgrades these should be able
# to run offline instead.
# reindex_threads:
# The number of threads to use for full offline reindexing of Gerrit data
# index_threads:
@ -735,27 +739,13 @@ class gerrit(
unless => '/usr/bin/test -f /etc/init.d/gerrit',
logoutput => true,
}
# We need to make the initial index for a fresh install. By default
# the gerrit init call will do that, but because we have
# pre-populated various directories above, even a fresh install
# looks like an upgrade and the init process leaves out the index.
# Unless we create it, gerrit refuses to start with errors like
# 1) No index versions ready; run Reindex
exec { 'gerrit-initial-index':
user => 'gerrit2',
command => "/usr/bin/java -jar ${gerrit_war} reindex -d ${gerrit_site} --threads ${reindex_threads}",
subscribe => [Exec['gerrit-initial-init']],
refreshonly => true,
logoutput => true,
}
# We can now online reindex, so no need to run this on upgrades by
# default.
if ($offline_reindex) {
exec { 'gerrit-reindex':
user => 'gerrit2',
command => "/usr/bin/java -jar ${gerrit_war} reindex -d ${gerrit_site} --threads ${reindex_threads}",
subscribe => [File['/home/gerrit2/review_site/bin/gerrit.war'],
Exec['gerrit-initial-init'],
Exec['gerrit-init']],
refreshonly => true,
logoutput => true,

View File

@ -42,6 +42,7 @@ class { '::gerrit':
ssh_replication_rsa_pubkey_contents => file('/tmp/gerrit-ssh-keys/ssh_replication_rsa_key.pub'),
secondary_index => true,
secondary_index_type => 'LUCENE',
offline_reindex => true,
commitmessage_params =>
{
maxSubjectLength => '60',