Indexes should choose an appropriate shard size when created

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

Problem to solve

When self managed instances set up Advanced search, multiple rake tasks must be run to determine shard sizes (estimate_cluster_size, estimate_shard_sizes). The output from the tasks must be u sed to manually set the shard sizes in the admin UI. This step is often forgotten and many folks keep the standard shard size of 5 which is set for smaller instances.

Proposal

When new indexes are created from scratch, detect and set the shard size for each index.

It is very important to not impact existing indexes that are recreated as part of zero downtime reindexing. This should only impact newly created indices.

Edited by 🤖 GitLab Bot 🤖