Skip to content

gitlab-production index gets created with a shard count of 5 regardless of configured setting

Summary

A customer recreated their indexes in non-production and production, and in both cases set the shard count for gitlab-production to 32.

The indexes got created with a shard count of 5, the default.

The first indication of an issue was when the info rake task reported the lower number of shards.

GitLab team members with access can read more in the ticket

Steps to reproduce

  1. Uncheck "Search with Elasticsearch enabled" in Admin UI.
  2. Change gitlab-production index number of shards from 5 (default) to 32 in Admin UI
  3. Execute gitlab-rake gitlab:elastic:delete_index
  4. Execute gitlab-rake gitlab:elastic:index

Example Project

What is the current bug behavior?

Index is created with the wrong shard count

What is the expected correct behavior?

Index is created with the specified shard count

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of: \`sudo gitlab-rake gitlab:env:info\`) (For installations from source run and paste the output of: \`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production\`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:check SANITIZE=true`)

(For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true`)

(we will only investigate if the tests are passing)

Possible fixes