Devise an approach to properly sequence issue relative_positions after Direct Transfer

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

RelationFactory was calculating relative positions for imported issues based on the relation index.

We encountered two problems with this approach:

  • The query generated while finding the current max relative position for an imported project fails for very large groups. (#458367 (closed))
  • Direct Transfer imports relations in batches. The offset was reset for each batch, effectively shuffling each batch of issues together. (#458367 (comment 2440355479))

We should devise an approach for setting the relative position on imported issues that satisfies the following:

  • Avoids the gap issue caused by preserving the relative positions from the source instance (i.e. jumping from 10 to 1,000,000)
  • Does not cause a database timeout when finding the max relative position across huge groups
  • Is compatible with the Direct Transfer approach of importing issues in batches, which makes maintaining a single offset challenging.
Edited Sep 29, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading