[RelativePositioning] Groups with many issues in a clump at the end can lead to exceptions and timeouts
Summary
We recently experienced an issue with a customer who had many issues at or near the maximum relative position. This caused exceptions when trying to place issues at the end, including timeouts for find_next_gap_before
.
The dataset in question only had 1,500 issues in it, so we need to ensure that in such a circumstance we can:
- efficiently place issues at the end, even if thousands of issues are in a run at the end
- efficiently find gaps, even if the current run is in the thousands
Steps to reproduce
We need to create a test-harness that has hundreds or thousands of issues in a clump at the end of the relative positioning range, to find the current limits of our queries, and then improve things.
Example Project
(If possible, please create an example project here on GitLab.com that exhibits the problematic behavior, and link to it here in the bug report)
(If you are using an older version of GitLab, this will also determine whether the bug is fixed in a more recent version)
What is the current bug behavior?
Exceptions and timeouts. Users with this behaviour are prevented from creating issues
What is the expected correct behavior?
Users can create issues quickly without exceptions
Relevant logs and/or screenshots
See #238416 (closed)
Output of checks
This bug happens on GitLab.com
Possible fixes
- Improve efficiency of gap finding
- improve rebalancing
- automatic background rebalancing
- allow admins to trigger rebalancing
- create alerts for groups that are getting large clumps at the end of their ranges