Files
gerrit/java/com
Dave Borowitz 776f4c43d9 Fix related changes for excessive numbers of patch sets
The first step in GetRelated is to look for all changes with a group
matching any of the groups mentioned in any of the patch sets of the
input change. The total number of groups is unbounded, and in the common
case of a 1-change series, each patch set will get its own group. This
means that the number of terms in the query grows, unbounded, with the
number of patch sets, potentially exceeding the backend-supported term
limit.

Work around this in the simplest way possible, by issuing multiple
queries and merging the results. This is a little ugly for now because
of the way that InternalQuery uses a single QueryProcessor instance, but
there are only two callers, so it's not that bad.

It is now possible for a single GetRelated call to fan out to multiple
search queries, but as this only affects changes with hundreds or
thousands of patch sets, and the fanout is only by a small factor, it
should have negligible performance impact.

Change-Id: I71b1172c0b91078d320ce56e15e1eaf218687a65
2018-01-08 09:23:53 -05:00
..