In order to shorten the downtime needed to reindex changes during a Gerrit upgrade the following strategy can be used:
make system unavailable so that users can't reach it anymore e.g. by changing port numbers (downtime starts)
take a full backup
run
./reindex.py -u gerrit-url -s backup-time
to write the list of changes which have been created or modified since the backup for the index preparation was created to a file “changes-to-reindex.list”
upgrade the production system to the new gerrit version skipping reindexing
copy the bulk of the new index from the copy system to the production system
run
./reindex.py -u gerrit-url
this reindexes all changes which have been created or modified after the backup was taken reading these changes from the file “changes-to-reindex.list”
smoketest the system
make the production system available to the users again (downtime ends)
For help on all available options run
./reindex -h
Prerequisites:
Install virtual python environment and run the script
pipenv sync pipenv shell ./reindex <options>