Update shard size and reindex
Background
Creating new indexes requires setting the shard size and replicas for the index. Shard size information cannot be guessed for GitLab.com or self managed instances and will likely be very different values as they are dependent on number of documents stored.
The Advanced Search documentation has guidance on how to determine shard size.
In the past, we've utilized zero downtime reindexing and manually setting shard sizes but
Proposal
Two indexes that need updates on GitLab.com:
- wiki - shard size is 200 and it should 5
- projects - shard size is 200 and it should 6
- users - shard size is 5 and it should be 8
Two solutions we've discussed:
- Automatically handle via Advanced Search migrations to support GitLab.com and self managed. The migration will calculate number of documents for the index, update the shard size for that index, and use zero downtime reindexing to move everything over.
- Show an alert in the Admin UI that says
The shard size is too big for "gitlab-production-users". Update shard size and press to reindex.
GitLab.com would need a manual fix using a Change Request Issue. An example issue of a reindexing change request: gitlab-com/gl-infra/production#7879 (closed)
Edited by Ravi Kumar