Files
gerrit/java/com/google/gerrit/server/index/change
Luca Milanesio 4dde1ff7e9 Online index upgrade: skip submit rules for closed changes
When upgrading an old changes index, it's not useful running
the submit rules on them for three reasons:

1. Gerrit setups may have millions of closed changes: running
   the submit rules again on them may take hours or days.

2. Closed changes would typically not be submittable at all,
   because they do not allow any submit operation.

3. Abandoned changes may be submittable when resumed, however
   the resume operation will re-compute the submit rule anyway
   so there is no value in evaluating them upfront.

Calculating submit rules for an ancient closed change can even
cause exceptions (e.g., target branch disappeared or removed)
and cause the failure of the changes index online migration.

By defining a thread-local flag when the online reindex is in
progress, the submit rule evaluator can "short-circuit" the
evaluation and return the closed record instead.

Bug: Issue 11148
Change-Id: I58674aa68d5a58d6f7e41773fe5d52ab3bb44acb
2019-07-09 23:56:20 +00:00
..